With pdfHTML 3.0.0 (released with iText Core 7.1.11) we improved the creation and/or merging of document outlines.

Details

  • When we generate a PDF file from iText that contains outlines, clicking such outlines should redirect to the corresponding contents.
  • It works fine in most cases but when we merge multiple PDFs where all the documents contain, some of the links redirect to the wrong content.
  • We need to implement an outline handler in such a way that it allows us to change the destination prefix name so that the PdfMerger can resolve the collisions.
  • Prior to version 7.1.11, this could not be done at all; each destination name had one prefix, and this created problems when merging two documents created by pdfHTML, because destination names in different documents had the same prefix, leading to merge conflicts.

The following example creates a custom outline handler to resolve this issue: