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.
Do you need to write or read JPEG in Java?
We have an easy guide on how to write JPEG in Java using ImageIO and JDeli.
You can learn how to read/write most of the image files in ImageIO. However, it gives little control over the process.
JDeli is easy to use and offers complete support, so why don't you give a try?