在特定頁面添加頁眉/頁腳

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 下載 18,560,885 | 版本: 2026.4 剛剛發布
Still Scrolling Icon

還在捲動嗎?

想要快速證明? PM > Install-Package IronPdf
執行範例 觀看您的 HTML 變成 PDF。