PdfReader reader; RandomAccessFileOrArray raFileOrArray = new RandomAccessFileOrArray("/tmp/large-file.pdf"); reader = new PdfReader(raFileOrArray, null);
Paulo On Fri, Jul 13, 2012 at 11:47 AM, Hanmant Sapkal <hanmant.sap...@gmail.com> wrote: > Hello, > > We are facing a problem while reading large Pdf files (around above 32 > Meg with 5000 pages). > I am using itext-5.3.0 System configuration = Solaris with > Weblogic-9.2 and JVM HotSpot > > I tried bellow constuctors to read the Pdf > > 1. PdfReader(byte[] pdfIn) > 2. PdfReader(RandomAccessFileOrArray raf, byte[] ownerPassword) > 3. PdfReader(String filename) > > But all of above stuck when Pdf is larger than 32 Meg > > java.lang.StackOverflowError > at java.util.HashMap$KeySet.iterator(HashMap.java:867) > at com.lowagie.text.pdf.PdfReader.removeUnusedNode(Unknown Source) > at com.lowagie.text.pdf.PdfReader.removeUnusedNode(Unknown Source) > at com.lowagie.text.pdf.PdfReader.removeUnusedNode(Unknown Source) > > Within my application, i have a servlet which reads pdf file and > write to out-put stream. I have an intermediate Servlet Wrapper which > wraps this output-stream and pass data to PdfReader. Bellow are > alternative methods which i tried but unfortunatly each of them cause > same exception error. > > Method 1: PdfReader(byte[] pdfIn) > -------------- > PdfReader reader; > reader = new PdfReader(pdfWrapper.getData()); > ======================================== > > Method 2: PdfReader(RandomAccessFileOrArray raf, byte[] ownerPassword) > -------------- > PdfReader reader; > RandomAccessFileOrArray raFileOrArray = new > RandomAccessFileOrArray(pdfWrapper.getData()); > reader = new PdfReader(raFileOrArray, null); > ======================================== > > Method 3:PdfReader(String filename) > -------------- > PdfReader reader; > reader = new PdfReader("/tmp/large-file.pdf"); // this path has rw permission. > ======================================== > > We also changed JVM Memory setting to... > > -Xms2048m -Xmx4096m -XX:PermSize=512m -XX:MaxPermSize2048m > -XX:ThreadStackSize=512 > > > So please help me out in this. > > Regards, > Hanmant. > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > 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 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ 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