Leon Atherton Leon is a developer at IDRsolutions and product manager for BuildVu. He is responsible for managing the BuildVu product strategy and roadmap, and also spends a lot of his time writing code to build new features, improve functionality, fix bugs, and improve the testing for BuildVu.

What you need to know about the PDF Converter V5 release

2 min read

Yesterday we unveiled version 5 of PDF Converter, bringing a multitude of new functionality and features, but what do you need to know about the new release?

If you have not already, I highly suggest reading the recent article where I give an overview of what’s new in V5. In this article I will go over the 5 points in detail to explain exactly what’s new, what has changed, and how to use it!

1. Page Turning:

Version 5 sees the first release of our page turning mode. We have been working hard on this, and still have plenty of improvements to make in the coming weeks and months.

pageturning

You can access an example of this in action here.

To enable this mode, you will need to set the view mode to HTML_VIEW_PAGETURNING. This can be done by setting the viewMode system property like so: -Dorg.jpedal.pdf2html.viewMode=”pageturning” or by setting in the ExtractPageAsHTML example file

2. New Text Modes:

We have removed our HTML5 Canvas usage, replacing with SVG. This has big advantages such as vector zoom functionality as well as removing the nasty JavaScript required for the canvas drawing.

In addition to this, we can now also output a fallback image for SVG modes so that if the browser does not support SVG the fallback image will be used instead, meaning that our files will now even display in IE6 (with some functionality not supported).

We now have a total of 6 SVG Text modes (with zoom functionality), and 3 Image Text modes (with big performance benefits). They are as follows:

SVG:

TEXT_SVG_REALTEXT
TEXT_SVG_SHAPETEXT_SELECTABLE
TEXT_SVG_SHAPETEXT_NONSELECTABLE
TEXT_SVG_REALTEXT_NOFALLBACK
TEXT_SVG_SHAPETEXT_SELECTABLE_NOFALLBACK
TEXT_SVG_SHAPETEXT_NONSELECTABLE_NOFALLBACK

Image:

TEXT_IMAGE_REALTEXT
TEXT_IMAGE_SHAPETEXT_SELECTABLE
TEXT_IMAGE_SHAPETEXT_NONSELECTABLE

The text mode can be altered by setting the viewMode system property using the above values without TEXT_, for example: -Dorg.jpedal.pdf2html.textMode=”image_realtext” or by setting in the ExtractPageAsHTML example file.

An example of the new SVG mode can be found here.

3. IE6/7/8 Support:

As mentioned in point 4, our files will now display even for non-HTML5 compatible browsers by using the image text modes or by using the fallback image when using SVG. Support is not 100%, but we will continue to improve compatibility in future releases.

ie6

This utilises a piece of JavaScript to detect SVG support, and insert SVG or an image into the page div. For example:

var pg1 = document.getElementById('pg1');
if (document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) {
pg1.innerHTML = '<object id="pdf1" style="width: 790px; height: 946px; background-color: #ffffff; -moz-transform: scale(1); z-index: -1;" width="790" height="946" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="01/1.svg" /><embed id="pdf1" style="width: 790px; height: 946px; background-color: #ffffff; -moz-transform: scale(1); z-index: -1;" width="790" height="946" type="application/x-shockwave-flash" src="01/1.svg" /></object>'; } else { pg1.innerHTML = '<img id="pdf1" style="width: 790px; height: 946px; background-color: #ffffff;" src="01/1.png" alt="" />'; }
4. Optimised file size and greater performance:

Alterations can be seen throughout the files, in particular to the way that text is defined. We have separated text positioning CSS from the style setting, in order to allow us to combine styles to improve file size. Browsers are also able to benefit from this, rendering pages faster. Here is a cut down version of what you can expect to see in the output:

<!-- Begin inline CSS -->
 
<!-- End inline CSS -->
 
<!-- Begin text definitions -->
Some things never change
Never trust a dog to watch your food.
Patrick, age 10
Our country has witnessed sweeping changes—from the untamed wild times of Buffalo Bill to the techno-
logical era of Bill Gates—but food has never lost its central role in our lives. Food not only sustains life but also
enriches us in many ways. It warms us on cold, dreary days, entices us with its many aromas, and provides end-
less variety to the everyday world. Food is also woven into the fabric of our Nation, our culture, our insti-
tutions, and our families. Food is on the scene when we celebrate and when we mourn. We use it for
camaraderie, as a gift, and as a reward (and sometimes as a crutch).
We are all aware of how food has changed. At the turn of the 20
<!-- End text definitions -->
5. Cleaner, clearer output:

As can be seen in the example above, we have wrapped different sections of the output to allow you to more easily understand, and to modify it for your specific use case.
In addition to the 5 points above, there will also be improved documentation of the converter in the support pages of our website in the coming weeks, allowing you to better understand how you are able to configure the converter for your specific use case. We will continue to provide regular weekly updates, so if there’s anything you would like to see, let us know and we will see what we can do!

You can find our more about our PDF to HTML5 converter by clicking here, or why not download the trial JAR?

This post is part of our “SVG Article Index” in these articles, we aim to help you build knowledge and understand SVG.

If you’re a first-time reader, or simply want to be notified when we post newarticles and updates, you can keep up to date by social media (Twitter, Facebook and Google+) or the Blog RSS.

Leon Atherton Leon is a developer at IDRsolutions and product manager for BuildVu. He is responsible for managing the BuildVu product strategy and roadmap, and also spends a lot of his time writing code to build new features, improve functionality, fix bugs, and improve the testing for BuildVu.

Leave a Reply

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