Improving the way settings get passed in ExtractPagesAsHTML

Over the last year, we have grown our PDF to HTML5 converter to be increasingly configurable, capable of suiting a huge range of requirements and potential uses. But in order to achieve this flexibility it has introduced some unwanted complexity, making potentially simple tasks increasingly complex.

For this reason, we have simplified the way in which settings are passed to the converter. This change has also allowed us to increase the documentation in our code example as well as improving the way in which we test configuration options as a result of the simplification.

ExtractPagesAsHTML (and ExtractPagesAsSVG) no longer calls setValue(), setBooleanValue or setStringValue() – instead, we create an separate ConversionOptions object just to hold the options. You can put in a Map of key values or use the get/set methods to set values in this (or a mix) and then pass this into the HTMLDisplay object.

This allows us to achieve 5 key objectives:-

1. If you are just writing Java code, you can set the values using Type safe values, vastly reducing the risk for errors when you write Java code.

2. It is equally easy to set key pair values (which we need for the online and cloud conversion).

3. It is easy to mix and match 1 and 2 (Map settings will always take priority).

4. It makes it much easier to extend and improve the features without causing more issues for our users by breaking the API.

5. It vastly reduces the complexity internally and makes it easier to make sure we consistently setup each mode no matter what order you set the values.

We are very sorry at potentially breaking your code but we think it is worth getting this done correctly and we are here to help if you need with altering your code. If you would like any guidance with adapting your code, please contact us and we will try to help.

All potential settings for both HTML and SVG output can be found in our ExtractPagesAsHTML and ExtractPagesAsSVG code examples, along with a description of the setting and its possible values.

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 new articles and updates, you can keep up to date by social media (Twitter, Facebook and Google+) or the  Blog RSS.

Related Posts:

The following two tabs change content below.
Leon is a developer at IDRsolutions and product manager for JPDF2HTML5. He is responsible for managing the JPDF2HTML5 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 JPDF2HTML5.
Leon Atherton

About Leon Atherton

Leon is a developer at IDRsolutions and product manager for JPDF2HTML5. He is responsible for managing the JPDF2HTML5 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 JPDF2HTML5.

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>