iText 5

How not to merge documents

This is an example that is used by many people, but it is completely wrong: one should not use PdfWriter to merge documents. Use PdfCopy or PdfSmartCopy instead.


incorrectexample

##GITHUB:https://github.com/itext/i7js-examples/blob/develop/src/main/java/com/itextpdf/samples/sandbox/merge/IncorrectExample.java##



Resources

https://github.com/itext/i5js-sandbox/blob/master/resources/pdfs/pages.pdf

Results

https://github.com/itext/i5js-sandbox/blob/master/cmpfiles/merge/cmp_pages_changed.pdf