Your page code is supposed to go into a page event...

Best Regards,
Paulo Soares

----- Original Message ----- 
From: "Collenghi, Ruggero" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 16:23
Subject: [iText-questions] Template


> I'm trying to use PdfTemplate, but it seems not to work. My document is
> made
> by one big PdfPTable (with some others PdfPTables nested). Some code
> follows..
> 
>       document.open();
>       PdfContentByte cb = writer.getDirectContent();
>       PdfTemplate templateNumeroPagina = cb.createTemplate(50 ,50);
>       BaseFont bf2 = BaseFont.createFont(BaseFont.TIMES_ROMAN,
> BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
>       String textPageNumber = "Pagina numero "+writer.getPageNumber()+"
> di
> ";
>       float lunghezzaNumeroPagina = bf2.getWidthPoint(textPageNumber,
> 11);
>       cb.beginText();
>       cb.setFontAndSize(bf2, 11);
>       cb.setTextMatrix(450, 35);
>       cb.showText(textPageNumber);
>       cb.endText();
>       templateNumeroPagina.rectangle(100,100,100,100);
>       cb.addTemplate(templateNumeroPagina, 450+lunghezzaNumeroPagina,
> 35);
> 
>      ...(here I build the PdfPTable)....
> 
> 
>       templateNumeroPagina.beginText();
>       templateNumeroPagina.setFontAndSize(bf2, 11);
>  
> templateNumeroPagina.showText(String.valueOf(writer.getPageNumber()));
>       templateNumeroPagina.endText();
>       document.close();
> 
> 
> ..the template is shown as footer only in the first page. 
> Thanks in advance to anyone has a good answer.
> Regards
> 
> 
> ************************************************************************
> ***********************
> The information contained in this message or any of its attachments may
> be confidential and is intended for the exclusive use of the
> addressee(s). Any disclosure, reproduction, distribution or other
> dissemination or use of this communication is strictly prohibited
> without the express permission of the sender. The views expressed in
> this email are those of the individual and not necessarily those of Sony
> or Sony affiliated companies. Sony email is for business use only. 
> 
> This email and any response may be monitored by Sony United Kingdom
> Limited.
> (04)
> ************************************************************************
> ***********************
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by: Geek Gift Procrastinating?
> Get the perfect geek gift now!  Before the Holidays pass you by.
> T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 



-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to