Place HTML on existing PDF pages in Python

Q:

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 (http://www.pdftron.com/pdfnet/samplecode.html#Html2Pdf). Once the HTML is imported in the target document you can place the imported HTML pages on existing PDF as shown in ImpositionTest sample (http://www.pdftron.com/pdfnet/samplecode.html#Imposition).

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 (http://www.pdftron.com/pdfnet/samplecode.html#PDFLayers). To print a PDF, see PDFPrint sample.