Add Classic Text Headers & Footers
Headers and Footers may be added to PDF documents in two distinct ways.
- Classic text headers and footers, which allows text-based headers to be added, with the option to merge in dynamic data.
- HTML headers and footers, which allows the developer to render HTML headers and footers to PDF files, also allowing the templating of dynamic data. This method is more flexible, although it is harder to use.
The class TextHeaderFooter
in IronPDF defines PDF headers and footers display options. This uses a logical approach to rendering headers and footers for the most common use cases.
In this example, we show you how to add classic text headers and footers to your PDF documents in IronPDF.
When adding headers and footers to your document, you have the option to set the headers text to be centered on the PDF document. You can also merge metadata into your header using placeholder strings. You can find these strings here. You can also add a horizontal line divider between the headers or footers and the page content on every page of the PDF document, influence font and font sizes etc. It is a very useful feature that ticks all the boxes.