When we convert a PDF to HTML we take the PDF page size. So for a standard PDF file, this might well be around 840×595 pixels. This is fine for most uses but sometime users want a larger version.
So we also include a scaling option. When we scale it, we preserve aspect ratio (otherwise the page would look odd). So you could alter this document to be 1680x 1190 pixels or any scaling value (we will multiply 840 and 595 or whatever the dimensions are by this number). And it can also be less than 1 (so you could reduce it to 420×298 pixels).
This works well but up until now it has need you to edit and recompile our example Java code. So we have added a flag so that you can set this value without this when you run the code.
So if you convert PDF to HTML with this Java code
java -Xmx512M -Dorg.jpedal.jai=true -Dorg.jpedal.scaling=”1.5″ -jar JPDF2HTML.jar /Users/markee/html/ /Users/markee/abc/
would give you an HTML file one and a half times the size of the PDF file.
What other features would you like to see as command line flags?
This post is part of our “HTML5 Article index” in these articles, we aim to help you understand the world of HTML5.
Latest posts by Mark Stephens (see all)
- How we are improving our code quality with IDEA in 2018 - March 7, 2018
- How we are improving our code quality with NetBeans in 2018 - March 1, 2018
- 3 ways that the European Union is changing the way Companies write software in 2018 - January 31, 2018
- IDRsolutions product range update for 2018 - January 22, 2018
- 4 ways Companies can make remote working successful - December 21, 2017