I'm attempting to merge 2 pdfs, (I'm following the examples in the iText in Action 2nd edition book) and I'm getting a null reference exception error when attempting to run this code:
MemoryStream stream = new MemoryStream();
document = new Document();
PdfCopy copy = new PdfCopy(document, stream);
document.Open(); //breakpoint here
The copy object has a null reference exception every time. I've been unable to find a simple answer to this anywhere else on this site. Thanks in advance!
According to this question, you have to ignore this exception. I am getting the same exception in iTextSharp 5.5.2. By simply ignoring it, I am able to proceed in my code and copy pages into a new pdf file alright.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With