Use PdfWriter.freeReader() after adding all the pages for that reader. You'll get better results with PdfCopy; see com.lowagie.tools.concat_pdf.java in the last version.
Best Regards, Paulo Soares > -----Original Message----- > From: J�r�me Keirse [SMTP:[EMAIL PROTECTED] > Sent: Tuesday, November 04, 2003 15:08 > To: [EMAIL PROTECTED] > Subject: [iText-questions] Concat pdf > > Hi, > > I was using IText java API with sucess for several months. I have to > concatenate a lot of pdf files and I'm getting > an error I can't resolve : > > I have got to scan several folders which contains pdf files and I have to > concatenate all the pdf files for each folder. After some concat-pdf were > sucessfull > created I'm randomly get the following exception (but it seems to be after > around 1000 concatenations) : > > java.io.FileNotFoundException : folder100/afile.pdf (too many open files) > at java.io.RandomAccessFile.open(Native Method) > at java.io.RandomAccessFile.<init> (RandomAccessFile.java : 200) > at java.io.RandomAccessFile.<init> (RandomAccessFile.java : 94) > at com.lowagie.text.pdf.RandomAcessFileOrArray.<init> (Unknown Source) > at com.lowagie.text.pdf.PRTokeniser.<init> (Unknown Source) > at com.lowagie.text.pdf.PdfReader.<init> (Unknown Source) > at com.lowagie.text.pdf.PdfReader.<init> (Unknown Source) > at com.test.PDF.concatPDF (MyFile.java : 200) > > I tried to release my IText object by several ways (obj.close(), obj = > null, System.gc()), but without any results. > > Is there a limit with the concat ? (I don't think ...) but are the files > opened by the PdfReader object closed correctly ? > > Any ideas? > > Thanks - J�r�me ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
