Hi all,
I'm getting OutOfMemoryError while trying to deal with existing PDFs.
The Error happens only for files larger then 3M (+-). Code is working fine
for files smaller than that.
Exception in thread "AgentThread: JavaAgent" java.lang.OutOfMemoryError
at com.itextpdf.text.pdf.IntHashtable.rehash(IntHashtable.java:245)
at com.itextpdf.text.pdf.IntHashtable.put(IntHashtable.java:292)
at
com.itextpdf.text.pdf.PdfStamperImp.getNewObjectNumber(PdfStamperImp.java:510)
at
com.itextpdf.text.pdf.PRIndirectReference.toPdf(PRIndirectReference.java:84)
at com.itextpdf.text.pdf.PdfArray.toPdf(PdfArray.java:180)
at com.itextpdf.text.pdf.PdfDictionary.toPdf(PdfDictionary.java:145)
at
com.itextpdf.text.pdf.PdfIndirectObject.writeTo(PdfIndirectObject.java:157)
at com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:391)
at com.itextpdf.text.pdf.PdfWriter.addToBody(PdfWriter.java:844)
at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:356)
at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:328)
at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:189)
The OutOfMemoryError is here:
PdfReader reader = new PdfReader(in);
"in" is the InputStream from a file.
I'm getting the same error while trying:
PdfReader reader = new PdfReader(PDFPath);
Any help would be appreciated.
Yotam
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
iText-questions mailing list
[email protected]
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