Hello everybody,
I've got a problem concerning the concatenation of PDFs: I need to
concatenate several (small) PDFs (up to 100) and i do get a big PDF. I can
view the PDF in my Adobe Acrobat Pro, I do see all the pages but I have a
problem printing it. After some level of concatenation (lets say about 10
or 12 concatenations) the following conent won't be printed anymore.
It is absolutley the same problem Sean Langford had 8 years ago:
http://www.mail-archive.com/[email protected]/msg03896.html
This is the way i concatenate the PDFs (they are part of RecordBundle).
The result shall be part of outputStream.
public static void concatPDFs(RecordBundle rb, OutputStream outputStream)
{
List<InputStream>listOfInputStreams = rb.getInputStreams();
Document document = new Document();
PdfCopy copy = new PdfCopy(document, outputStream);
document.open();
PdfReader reader;
for (int i = 0; i < listOfInputStreams.size(); i++) {
InputStream is = (InputStream) listOfInputStreams.get(i);
reader = new PdfReader(is);
int n = reader.getNumberOfPages();
for (int page = 0; page < n; ) {
copy.addPage(copy.getImportedPage(reader,
++page));
}
}
document.close();
copy.close();
outputStream.flush();
outputStream.close();
}
I tried several ways (including PdfSmartCopy or PdfCopyFields), the
problem still remains.
Thank you for your help in advance!
Martin Fetz------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
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