且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Itextsharp向包含重叠到其他页面的表的Pdf文档添加页眉/页脚。每个页面都应出现标题

更新时间:2022-12-21 21:58:23

得到后援头事件必须在打开文档之前被放置。

使用跨度>(PdfWriter作家= PdfWriter.GetInstance(文件, fs))
{
// 现在插入标题
writer .PageEvent = new Header();

// 标题结尾
// 步骤4:打开文档
doc.Open();





}


Good pple

How to add a header/footer to a pdf document containing tables that overlaps to other pages using iTextSharp? The header/footer should appear on everypage

Thank you in advance

Got it.The header event must be placed before opening the doc.
using (PdfWriter writer = PdfWriter.GetInstance(doc, fs))
                {
                    //now inserting header
                    writer.PageEvent = new Header();

                    // end of header
                    // Step 4: Openning the Document
                    doc.Open();
.
.
.
.
.
}