Add Header and Footer for PDF using iTextsharp

后端 未结 9 1661
情歌与酒
情歌与酒 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:22

    pdfDoc.Open();
    Paragraph para = new Paragraph("Hello World", new Font(Font.FontFamily.HELVETICA, 22));
    para.Alignment = Element.ALIGN_CENTER;
    pdfDoc.Add(para);
    pdfDoc.Add(new Paragraph("\r\n"));
    htmlparser.Parse(sr);
    pdfDoc.Close();
    

提交回复
热议问题