I really like the PDFNet SDK. I was looking into the HTML to PDF
functionality in the PDFNet SDK.
When I convert my HTML file to PDF, it adds 1 html page to 1 PDF
page. This makes almost 60% of each PDF page blank and size of my PDF
Is there any way to avoid or minimize this blank space in each page?
Or let multiple html pages come in each PDF page?
A: Each web page starts a new PDF page. So if you call
HTML2PDF.InsertFromUrl 4 times, then the resulting PDF will contain at
a minimum 4 pages. There are currently no plans to change this.
The only alternative I can offer at this time is to do some post
processing of the PDF. Using our ElementReader you can determine the
minimum bounding box containing the visible content on each page. You
can parse all the elements on a page using ElementReader, and for each
element get the bounding box, and union it with one master rectangle.
Once you have the visible content bounding box for each page, you
could determine if there is room to merge pages. If so, you would use
ElementWriter to write the elements from one page to the previous, but
with their y position shifted down to be below the previous content.
Please see the following links for more info