I'm trying to use PdfStamper to overwrite the footer areas of a ten page document that was generated using PdfCopy and and PdfWriter... I'm then reading in the generated file (inFile) for processing by PdfStamper(). There's not a lot of doc around PdfStamper... it appears that I don't have to do a new Document()...
PdfReader reader = new PdfReader(inFile.toURL());
PdfStamper stamper = new PdfStamper(reader,
new FileOutputStream(outTestFile));
int n = reader.getNumberOfPages();
PdfContentByte cb; PdfImportedPage page; PdfTemplate tp;for (int i = 0; i<n;) {
++i;
cb = stamper.getUnderContent(i);
page = stamper.getImportedPage(reader, i); tp = cb.addTemplate(page, 400, 400);
tp.beginText();
tp.setFontAndSize(bf,14);
tp.setTextMatrix(100,100);
tp.showText("Footer Test: page " + i);
tp.endText();
}
stamper.close();-- David H. Young SAMBA Holdings, Inc. Chief Technology Officer 1730 Monta�o NW Albuquerque, NM 87107 505.797.2622 x113 http://www.samba.biz
-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise Linux in the Boardroom; in the Front Office; & in the Server Room http://www.enterpriselinuxforum.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions
