sombra wrote:

Thanks, a lot, but can you give me more information, I have try to find with setFieldCache. But the only i have found its generating physical pdf files. I would like to find something whithout generating temporal pdf files to get the final pdf.

What if you used some of your creativity, and
combined different examples into something like this:

Document document = new Document();
PdfCopy copy = new PdfCopy(document, new FileOutputStream("newform.pdf"));
document.open();
PdfReader reader;
PdfStamper stamper;
ByteArrayOutputStream baos;
int pages;
HashMap fieldCache = new HashMap();
for (int i = 0; i < db.length; i++) {
 reader = new PdfReader("form.pdf");
 baos = new ByteArrayOutputStream();
 stamper = new PdfStamper(reader, baos);
 form = stamper.getAcroFields();
 form.setFieldCache(fieldCache);
 form.setExtraMargin(12, -3);
 form.setField("person.name", db[i][0]);
 form.setField("person.address", db[i][1]);
 stamper.setFormFlattening(true);
 stamper.close();
 reader = new PdfReader(baos.toByteArray());
 pages = reader.getNumberOfPages();
 for (int i = 0; i < pages; ) {
   ++i;
   copy.addPage(copy.getImportedPage(reader, i));
 }
}
document.close();


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to