iText 5 is the previous major version of iText's leading PDF SDK. iText 5 has been EOL, and is no longer developed. Switch your project to iText 7, integrating the latest developments. Check related iText 7 content!
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.