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.
This post is part of our “SVG Article Index” in these articles, we aim to help you build knowledge and understand SVG.
Latest posts by Leon Atherton (see all)
- Making a Simple Basecamp Chatbot with NodeJS - November 29, 2017
- My Business of Software Conference Experience – BoS Europe 2017 - June 7, 2017
- Do you still need IE8 support in JPDF2HTML5? - February 8, 2017
- JPDF2HTML5 2016 Roundup and looking ahead to 2017 - December 20, 2016
- What Chrome 45 dropping NPAPI Plug-in support means - September 10, 2015