Add Header and Footer for PDF using iTextsharp

后端 未结 9 1696
情歌与酒
情歌与酒 2020-11-27 04:04

How can I add header and footer for each page in the pdf.

Headed will contain just a text Footer will contain a text and pagination for pdf (Page : 1 of 4)

H

9条回答
  •  误落风尘
    2020-11-27 04:37

    Just add this line before opening the document (must be before):

            document.Header = new HeaderFooter(new Phrase("Header Text"), false);
            document.Open();
    

提交回复
热议问题