Posted by a ceTe Software moderator
Hello,
The MergeDocument class does not modify the source PDF, when you call the Draw method to save the PDF it will create a new PDF document. If you are loading the source PDF from file path you won’t be able to call the Draw method to that path again as the MergerDocument class holds the file handle to the source PDF. If you want to overwrite the source PDF, you would need to load the source PDF into a byte array and create the MergeDocument object using the PDF byte array.
byte[] pdfbytes = File.ReadAllBytes(@"source.pdf");
PdfDocument pdf = new PdfDocument(pdfbytes);
MergeDocument document = new MergeDocument(pdf);
document.Draw(@"source.pdf");
Thanks,
ceTe Software Support Team.