在特定页面添加页眉/页脚

IronPDF具有为现有PDF文件添加页眉和页脚的功能。

我们也可以使用IronPDF的方法为旧的或新的PDF文档添加自定义的页眉和页脚。 要做到这一点,我们在PDF渲染之后使用以下方法:

  • 使用IronPDF添加文本标题使用 IronPdf.PdfDocument.AddHeaders(IronPdf.TextHeaderFooter, System.Boolean, System.Collections.Generic.IEnumerable<System.Int32>)
  • 使用IronPDF添加文本页脚IronPdf.PdfDocument.AddFooters(IronPdf.TextHeaderFooter, System.Boolean, System.Collections.Generic.IEnumerable<System.Int32>)
  • 使用IronPDF添加 HTML 标头使用 IronPdf.PdfDocument.AddHTMLHeaders(IronPdf.HtmlHeaderFooter, System.Boolean, System.Collections.Generic.IEnumerable<System.Int32>)
  • 使用IronPDF添加 HTML 页脚IronPdf.PdfDocument.AddHTMLFooters(IronPdf.HtmlHeaderFooter, System.Boolean, System.Collections.Generic.IEnumerable<System.Int32>)

探索 IronPdf 页眉页脚操作指南

准备开始了吗?
Nuget 下载 17,803,474 | 版本: 2026.3 刚刚发布
Still Scrolling Icon

还在滚动吗?

想快速获得证据? PM > Install-Package IronPdf
运行示例看着你的HTML代码变成PDF文件。