Loading tool...
Add custom headers and footers to PDFs with our free PDF Header Footer Adder, enabling page numbers, dates, custom text, and flexible formatting. The tool supports custom text headers and footers configured independently, automatic page numbering with multiple format options, date insertion for version control, position control to place headers and footers anywhere, and font customization to match your document style. Headers and footers can be applied to all pages or selected pages, making it easy to skip the cover page or apply only to body pages. This is essential for creating professional documents with proper pagination, adding version control information, implementing legal document formatting, branding reports with company information, and ensuring academic formatting compliance.
Add page numbers to PDFs for proper document pagination and reference.
Add version numbers and dates to headers/footers for document version tracking.
Add required legal headers and footers such as "Confidential" or case numbers.
Add company name, department, and report information to headers and footers.
Add headers with author names and footers with page numbers for academic paper formatting.
Use different headers/footers in different sections to indicate chapters or major document sections.
Adding headers and footers to PDF pages is an exercise in direct content stream modification, requiring a thorough understanding of the PDF graphics model and coordinate system. Every visible element on a PDF page — text, lines, shapes, images — is produced by operators in the page's content stream. Adding a header or footer means appending new drawing operators to this stream that render text at precise positions in the page's margin areas.
The PDF coordinate system is foundational to correct header and footer placement. The default origin (0,0) is at the bottom-left corner of the page, with x increasing to the right and y increasing upward. Units are in points, where 1 point equals 1/72 of an inch. To place a footer 36 points (half an inch) from the bottom of a Letter-size page, the y-coordinate would be 36. To place a header 36 points from the top, the y-coordinate would be 792 minus 36, or 756 (since Letter size is 792 points tall). Horizontal positioning for left-aligned, centered, or right-aligned text requires calculating based on the page width and the rendered width of the text string.
Text rendering in the PDF graphics model involves several operators working in concert. The BT operator begins a text object, and ET ends it. Within a text object, the Tf operator selects a font and size, the Td or Tm operator sets the text position, and Tj or TJ renders the actual characters. A complete header rendering sequence looks conceptually like: save graphics state (q), begin text (BT), set font (Tf), set position (Td), show string (Tj), end text (ET), restore graphics state (Q). The graphics state save and restore ensure that font and position changes for the header do not affect subsequent content rendering.
Font handling for header and footer text requires adding a font resource to the page's resource dictionary. The simplest approach uses one of the 14 standard PDF fonts — Helvetica, Times-Roman, Courier, and their variants — which are guaranteed to be available in every PDF reader without embedding. Using a standard font avoids increasing file size with embedded font data while ensuring the text renders consistently across all platforms and devices.
Dynamic content like page numbers requires generating different text for each page. The tool must iterate through all pages, compute the current page number and total page count, format them according to the selected style (such as "Page 3 of 15" or "iii"), and inject page-specific text operators into each page's content stream. Date strings are computed once and applied uniformly to all selected pages.
A critical consideration is handling pages with different dimensions or orientations within the same document. A document might mix Letter and Legal pages, or contain rotated landscape pages. The header and footer tool must read each page's MediaBox (or CropBox) to determine its dimensions and the /Rotate attribute to determine its orientation, then calculate header and footer positions accordingly. Placing text at y=756 on a page that is only 612 points tall (because it is landscape) would push the header off the visible area. Robust implementations adapt positioning to each page's actual dimensions and rotation.
Yes, you can configure a header and a footer independently. Each can have its own text content, alignment, font, and size, allowing you to add page numbers at the bottom and a title at the top simultaneously.
Yes, the tool supports dynamic page numbering. You can insert page numbers in the header or footer and choose from formats like "Page 1", "1 of 10", or simple numbering. The numbers update automatically for each page.
By default, headers and footers are applied to all pages. You can customize which pages receive them, such as skipping the first page or applying them only to odd or even pages.
Yes, date insertion is supported. You can add the current date in your header or footer, which is useful for document versioning, legal filings, or keeping track of when a document was printed.
All processing happens directly in your browser. Your files never leave your device and are never uploaded to any server.