Place HTML on existing PDF pages in Python


Can we use PDFTron PDFNet for the following:

In Python, push HTML content to a specific location on the document as a layer?

Then later use your API to flatten the document, for printing purposes?

A: Yes, this is possible.

To import HTML pages to new or existing PDF, use ‘pdftron.PDF.Html2Pdf()’ as shown in Html2Pdf sample ( Once the HTML is imported in the target document you can place the imported HTML pages on existing PDF as shown in ImpositionTest sample (

If you need to keep the content in separate layers you can do so using OCG (Optional Content Groups) API as shown in LayersTest sample ( To print a PDF, see PDFPrint sample.