Hi everyone,
Iâm trying to create a single PDF file by concatenating multiple single pages PDF. Each single page PDF is about 6 MO.
I use the code below:
pdfr=new PdfReader(loc);
if(pdfr.getNumberOfPages() > 1)
System.out.println("Warning: Multiple page found in this document.\n" +
"\tWill only take the first one !");
PdfImportedPage page= this.doc.getPdfWriter().getImportedPage(pdfr, 1); //this.doc is a PdfContentByte
this.doc.getPdfWriter().freeReader(pdfr);
this.doc.addTemplate(page, x, y);
page=null;
pdfr=null;
this.doc.getPdfWriter().flush();
System.gc();
Is there something I can do to reduce the memory usage? Iâve tried with a PdfCopy instead of the PdfWriter, but it didnât help.
Or maybe because of iText limitation the only solution would be to have more RAM (and playing around with the heap size)?
******************************************
Michael TOULA
Software Engineer
Dalim Software GmbH
Strassburger Str. 6
D-77694
Kehl am Rhein
GERMANY
tel: +49 7851 919 652
fax: +49 7851 735 76
web: www.dalim.com
******************************************
SEE US AT DRUPA 2004 - May 6th-19th. Hall 9, Booth B62