Mark Stephens Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

PDF to HTML5 conversion – Hyphen is a special character (Part 2)

40 sec read

In a previous article I explained how hyphens could effect the layout of text and require some complex work arounds with the default settings. In this article I am going to show you a much simpler solution, thanks to the magic of CSS.

CSS is a set of commands which allow you to alter the default layout of your HTML. It is extremely powerful and its only weakness is the fact that it is not supported by all browsers in the same way. By the way do you ever get that sinking feeling when you find the perfect CSS command followed by the dreaded ‘Not supported in all browsers‘ comment?

Well CSS has a really neat trick for handling cases like this. You can add these 2 very useful commands to the CSS attached to the div.

white-space:nowrap;

overflow:visible;

The first tells the browser not to wrap the contents of the div where it finds white space (which includes hyphens) while second defines how any overflow is handled. It is a really good example of how useful CSS can be. Do you have any favourite tricks with CSS?

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Mark Stephens Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Converting your PDF files to HTML5 with BuildVu 

Recently we announced our updated product range for 2018 and are rebranding some existing products, like JPDF2HTML5 which has been renamed to BuildVu. It...
Georgia Ingham
2 min read

Favourite resources from our HTML development team

As the web progresses and grows, so do the technologies that come along with it. Trying to keep on top of everything you need...
Ovidijus Okinskas
1 min read

How HTML5 Javadocs in Java 9 will make your…

Here at IDRsolutions we are very excited about Java 9 and have written a series of articles explaining some of the main features. In...
Rob
1 min read

Leave a Reply

Your email address will not be published. Required fields are marked *