Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] Adding Header Footer in the PDF document

Bruno

2006-07-28

Replies:

Swati Pathak wrote:

> Hello,
>
> I am using iTextSharp version 3.1.2 for PDF creation. My requirement
> is to add Header and Footer in the document. I tried using
> HeaderFooter object using following lines of code
>
> HeaderFooter header = new HeaderFooter(new Phrase("Selection Report"),
> false);
>
> myDocument.Header = header;
>
> The Header is not getting added in the document.  
>
> Graphic grx = new Graphic();
>
>         grx.DrawHorizontalLine(1, iTextSharp.text.Color.BLACK, 10,
> 10, myDocument.PageSize.Width);
>
>         grx.Stroke();
>
>         myDocument.Add(grx);
>
> The horizontal line is also not getting added in the document using
> above line of code.
>
> Could you please let me know if anything is wrong in the code and how
> to add Header, Footer and horizontal line?
>
> Your earliest help is most appreciated.
>
Where did you find out about HeaderFooter and Graphic.
This is very old functionality.
It is no longer supported.
Please consult http://itextdocs.lowagie.com/tutorial/
for more info. Read the chapters about page events
(to add the header) and about direct content (to draw
a line).
br,
Bruno


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.