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

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檔。