HTML to PDF Table of contents

I am trying to add a table of contents in a PDF while converting from HTML to PDF. This will only work if I add to param.pyPDFHeaderHTMLTemplate and Call HTMLToPDF.

If I set this value in the markup or stream name, nothing gets generated.

I can not have this in the header as I do not want this to get generated on all pages.

I am used PD4ML pd4ml:toc inside of the Markup HTML

@EricL3813 please can you confirm that you carried out a PSC search on the below PSC resources?

HTMLtoPDF

PD4ML

To add a table of contents in a PDF while converting from HTML to PDF using PD4ML you should define the HTML code for the header using the param.pyPDFHeaderHTMLTemplate. If you want the table of contents to appear only on specific pages and not on all pages avoid placing it in the header. Instead you can include it in the body of the HTML markup that you pass to the HTMLToPDF activity. Ensure that you are using the correct parameters and that the HTML is structured properly to avoid any issues with generation.

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

Troubleshooting HTML-to-PDF Conversion issues

Note of the below known limitations for which exist the enhancement requests below:

1. FDBK-71951 - HTMLToPDF routine: Limitation with supported features

Description
Below are the limitations with HTMLToPDF routine that can be addressed.

a. Currently there is an option to pass a footer template HTML as a HTML stream via parameter pyPDFFooterHTMLTemplate but there is no way to pass varying footers to HTMLToPDF based on page number, e.g., in first page one footer and sceond page onwards another. The same is possible in PD4ML API, but the PD4ML JSP tags are not accepted in Markup parameter of HTMLToPDF activity. The

b. The pyEnableSmartTableBreaks parameter allows repeating table headers. But rows are moved to the next page completely instead of splitting it across pages.

The above issues can be addressed if there is away to pass PD4ML JSP tags via Markup or some other parameter.

2. FDBK-5477 - Cannot specify header and footer using OOTB HTMLToPDF