onStartPage() may have that effect if you have images. If you don't have
Table you can safely put the code in onEndPage() and have no surprises.

Best Regards,
Paulo Soares

----- Original Message ----- 
From: "Vladlen Bray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 07, 2004 19:20
Subject: [iText-questions] Watermark


> This is a code I'm using, taken directly from itext-paulo-130 version:
> public void onStartPage(PdfWriter writer, Document document) {
>         if (writer.getPageNumber() < 3) {
>             PdfContentByte cb = writer.getDirectContentUnder();
>             cb.saveState();
>             cb.setColorFill(Color.pink);
>             cb.beginText();
>             cb.setFontAndSize(helv, 48);
>             cb.showTextAligned(Element.ALIGN_CENTER, "Draft",
> document.getPageSize().width() / 2, document.getPageSize().height() / 2,
> 45);
>             cb.endText();
>             cb.restoreState();
>         }
>
> The problem is it adds extra page to the original document. Basically if I
> have 7 page document it will create 8 page document with an extra cover
> page.
>
> _________________________________________________________________
> Persistent heartburn? Check out Digestive Health & Wellness for
information
> and advice. http://gerd.msn.com/default.asp
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to