Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

PDF to HTML5 conversion – 2 ways to handle text content

40 sec read

When you convert a PDF file into HTML5, there are different ways  to do things. With the text, you can for example make use of the canvas or you can put the text in a div and embed the font. Both approaches have their advantages and disadvantages. Here are TWO ways to show text:-

1. Put the text in divs. This produces very small files, text is selectable and scales beautifully but there is a tradeoff in exact spacing.

2. Draw the text as shapes on the canvas. If you have your own font engine (and we have spent 8 years building one including Truetype font hinting), writing the text to canvas gives a very good representation but the text is not selectable and the files are larger.

We like our customers to have the choice so we have been working on option 1 and added First release of option 2 in todays release. You can see the results in yesterday’s blog post.

What would you like to see next?

This post is part of our “HTML5 Article index” in these articles, we aim to help you understand the world of HTML5.

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 has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

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

Leave a Reply

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

IDRsolutions Ltd 2019. All rights reserved.