todd.patterson, todd.patterson wrote > I have changed the code to the following I am now using pdfCopy. I still > have the same error stating I can not delete the original pdf files > because they are in use.
If you read my original comment once again you'll see that you reacted to my remark that you used a non-optimal way to merge PDFs, but you unfortunately ignored the prime issue: mkl wrote > you close the document but I don't see you closing any of the PdfReaders > or the PdfWriter, neither explicitely nor implicitely (e.g. by utilizing a > using statement). iText in the latest 10...15 releases more and more > stopped to do close calls itself as that disturbs some use cases, e.g. > when pages from a single document are imported in multiple other > documents. Thus, please do close the PdfReaders you open. And do close the PdfWriter/PdfCopy in the end. Furthermore, as Gerold Krommer already pointed out, you open pdfDoc multiple times. If you are lucky that is ignored. Otherwise it may result in trouble. And you set page sizes while copying. That is not needed when working with PdfCopy. Regards, Michael -- View this message in context: http://itext-general.2136553.n4.nabble.com/Merge-PDF-File-release-tp4658071p4658098.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php