I am doing this to copy two pdf documents that have form elements and signature
blocks. Everything copies as expected however on the first document ONLY it
looses the XObject references causing me not able to complete my task. Can
anyone advise please?
Document document = new Document();
PdfCopy copy = new PdfCopy(document, baos);
document.open();
int n;
// loop over the documents you want to concatenate
for (int i = 0; i < files.length; i++) {
PdfReader reader = new PdfReader(files[i]);
// loop over the pages in that document
n = reader.getNumberOfPages();
for (int page = 0; page < n; ){
copy.addPage(copy.getImportedPage(reader, ++page));
}
PRAcroForm form = reader.getAcroForm();
if (form != null)
copy.copyAcroForm(reader);
copy.getAcroForm();
copy.freeReader(reader);
copy.flush();
}
document.close();
Patricia Brander
Unit 10260 - B2W.A3
210.775-8716
<<inline: Picture (Device Independent Bitmap) 1.jpg>>
------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________ 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
