Skip to main content
Skip table of contents

Merging documents with bookmarks

This example was originally written in answer to the question How to merge PDFs and add bookmarks? for iText 5.

The code here is a direct port from the iText 5 code. Merging documents while maintaining bookmarks in iText 7 and later versions is done automatically when using the PdfMerger (Java/.NET) class.

insertandadaptoutlines

##GITHUB:https://github.com/itext/i5js-sandbox/blob/master/src/main/java/sandbox/merge/MergeWithOutlines.java##

##GITHUB:https://github.com/itext/i7ns-samples/blob/develop/itext/itext.samples/itext/samples/sandbox/merge/InsertAndAdaptOutlines.cs##

mergewithoutlines

##GITHUB:https://github.com/itext/i5js-sandbox/blob/master/src/main/java/sandbox/merge/InsertAndAdaptOutlines.java##

##GITHUB:https://github.com/itext/i7ns-samples/blob/develop/itext/itext.samples/itext/samples/sandbox/merge/MergeWithOutlines.cs##

Resources

bookmarks.pdf
hello.pdf
links1.pdf
links2.pdf

Results

cmp_insert_and_adapt_outlines.pdf

cmp_merge_with_outlines.pdf


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.