Your code is wrong. See the example stamped.java at itextpdf.sf.net.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: David H. Young [SMTP:[EMAIL PROTECTED]
> Sent: Sunday, October 19, 2003 23:28
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] using PdfStamper to update footer area...
> 
> I'm just not getting how to make this work, so here goes...
> 
> 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


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to