How to convert HTML file to PDF file with page breaks in htmltools.exe Command Line software?

Hi,

I have a previous version of htmltools.exe that does not support page breaks. I understand that your new version does.

How does one cause a page break while converting HTML to PDF? Can I enter a special character in the HTML to cause the page to break there or is it by page length only?

(What I really want to do is break and have the first page be the correct height even if I break at the half page and continue on the next page - just like MS Word would do if I press CTRL-Break.)

Is there an upgrade price for the server version?

Thanks,
Customer
------------------------------------------
Thanks for your message, the new version of htmltools.exe does support page breaks properly, you can use following HTML code to break following contents to a new PDF page,

<div style="page-break-before:always;"></div>

You can use following sample HTML file for test purpose,

<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<div style="page-break-before:always;"></div>
<p><b><font face="Verdana" color="#FF0000">Break page at here #1</font></b></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<div style="page-break-before:always;"></div>
<p><b><font face="Verdana" color="#FF0000">Break page at here #2</font></b></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>
<p><font face="Verdana">Page test...</font></p>

Please put above HTML codes to a sample HTML file, then you can run following command line to convert this HTML file to a PDF file with page breaks properly,

htmltools.exe -webkit test-pagebreaks.htm test-pagebreaks.pdf

This is the screenshot of converted PDF file with page breaks,

image

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

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


Verify Code   If you cannot see the CheckCode image,please refresh the page again!