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 HTML conversion – relative positioning of content

50 sec read

One of the most interesting things about developing the PDF to HTML convertor is the number of ideas and enhancements which arise from actual usage. I am constantly surprised at the number of different uses people have found for it and the creative ways it is being used (if you are doing something interesting and would like to write a short blog post to publicise it let us know).

One of the requests we have had from several customers in the ability to use the HTML more flexibly. The content is positioned on the page using CSS. This works fine until users want to manipulate the CSS because we use absolute positions.

So for today’s release we have had an option to place all our content inside a div tag with relative positioning.  We give this div the css tag name ‘jpedal’ as we think this should be reasonably unique. This allows us to use absolute positions within our div and users to alter the CSS and content around it.

The new option is enabled by default in our example code or you can add to your code with this line

/**
* include our content in a Div so you can position relative
*/HTMLoutput.setBooleanValue(HTMLDisplay.EncloseContentInDiv,true);

This should make it much easier if you wish to use the content with your own set of RSS tags or wrap it in other content. Any other suggestions?

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

2 Replies to “PDF to HTML conversion – relative positioning of content”

  1. Hi, Mark
    Your blog is very helpful. Nice to read it.
    My project uses JPedal to convert PDF file to HTML. The version of JPedal is 5.35b04.
    I think it is long after your article. So I can not find the configuration option – HTMLDisplay.EncloseContentInDiv.
    I haven’t found the deprecated message for this option on the official site yet.
    Could you help with the relative position in my JPedal version, please? Thanks.

    1. Hi Ellen,

      JPedal is actually the Java PDF library to convert PDF2Image and provide a Java Viewer. JPDF2HTML5 is the PDF2HTML5 converter.

      5.35b04 is actually a fairly old version. I would recommend you update to the latest (which has a huge number of enhancements and new features) and our support team can advise on any transition issues.

Leave a Reply

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