Add Header & Footer Text to PDF

Stamp custom titles, dates, confidentiality notices, and page counts across all pages

📄

Drop PDF here or browse files

All headers and footers are stamped client-side with native vector typography

Select PDF File
In-Depth Technical Guide•8 min read•2RUN Engineering Team
100% Client-Side • Zero Upload

Add Header and Footer to PDF Online: Dynamic Variables, Multi-Column Stamping & In-Browser PDF-Lib

⚡How to Add Headers and Footers to a PDF in 4 Steps

1

1. Import Your PDF Document

Select or drag and drop your PDF into the secure workspace. The file is processed locally in browser RAM with zero server uploads.

2

2. Configure Header & Footer Zones

Enter your desired text in the six layout zones. Use dynamic macros like `{page}`, `{total}`, and `{date}` for automated metadata.

3

3. Set Margins, Typography & Exclusions

Select font family, size, color, and margin offsets. Check 'Skip First Page' to keep your cover page clean.

4

4. Apply Framing and Download

Click 'Add Header & Footer' to composite vector text operators into the document streams. Download your finalized publication immediately.

Professional document presentation requires structured header and footer framing. Whether publishing enterprise research papers, corporate annual reports, legal briefs, training manuals, or formal product documentation, headers and footers provide critical organizational context: company branding, document titles, confidentiality classifications, author attribution, dates, and page counts. Without consistent running headers and footers, multi-page documents look unpolished, unbranded, and disjointed when distributed across departments or printed onto physical paper.

Our browser-native Add Header and Footer tool delivers comprehensive, publication-grade document labeling directly inside your browser. Featuring a versatile six-zone layout grid (Left, Center, and Right zones across both Header and Footer bands), dynamic macro variable expansion (`{page}`, `{total}`, `{date}`, `{title}`, `{filename}`), custom font formatting, and cover page exclusions, you can transform plain documents into cohesive enterprise publications in seconds. Operating with 100% client-side privacy via Web Workers and PDF-Lib, your confidential corporate files never touch external cloud servers.

Read the full technical guide

The Anatomy of Professional Headers & Footers: The Six-Zone Grid

In enterprise publishing standards, running headers and footers are divided into distinct functional zones. Professional layout designers rarely place all text in a single block; they distribute metadata logically across the upper and lower margins.

Our tool implements the industry-standard six-zone layout model: Header Left (typically used for document title or section heading), Header Center (used for corporate logos or security classifications like 'CONFIDENTIAL'), Header Right (used for date or department code), Footer Left (used for copyright notices or file names), Footer Center (used for confidentiality notices), and Footer Right (used for dynamic pagination like 'Page X of Y'). Our engine coordinates these zones simultaneously, ensuring balanced visual weighting across every page.

Dynamic Macro Variable Expansion: Automated Metadata Insertion

Manually typing page counts or document titles across dozens of pages is tedious and prone to errors. Our header and footer engine features intelligent macro variable expansion, parsing dynamic placeholder tags in real time during PDF compilation.

Supported macros include `{page}` for current page number, `{total}` for total document page count, `{date}` for current execution date (formatted to ISO standards or local conventions), `{time}` for current timestamp, and `{filename}` for the original uploaded file name. When you enter a string like 'Confidential Document — Page {page} of {total}', our worker dynamically evaluates the macro per page, injecting the calculated text string seamlessly into the page content stream.

Cartesian Coordinate Systems, MediaBox Boundaries & Bleed Offsets

A frequent failure of amateur PDF tools is that headers or footers overlap with existing body text or clip against physical printer margins. In the PDF specification, page dimensions are defined by five distinct box dictionaries: `/MediaBox` (the physical sheet size), `/CropBox` (the displayed visible area), `/BleedBox`, `/TrimBox`, and `/ArtBox`.

Our tool measures the active `/CropBox` of every page, establishing top and bottom margin keep-out zones (typically 36 to 54 points, or 0.5 to 0.75 inches). The engine calculates exact baseline positions relative to the bottom-left coordinate origin `(0, 0)`, ensuring that headers float comfortably in the top margin and footers sit cleanly above the bottom edge without colliding with body paragraphs or charts.

Alternating Recto/Verso Layouts for Commercial Book Binding

When publishing books, manuals, or bound reports intended for double-sided duplex printing, headers and footers must adapt to page parity. On odd-numbered right-hand pages (recto), chapter titles and page numbers belong on the outer right edge. On even-numbered left-hand pages (verso), document titles and page numbers belong on the outer left edge.

Our tool includes dedicated Recto/Verso alternating logic. When enabled, outer header and footer zones swap positions automatically between even and odd pages, ensuring that bound materials present a professional, symmetrical appearance when opened as a two-page spread.

Zero-Knowledge Local Processing: Protecting Proprietary Work Product

Enterprise documents that require running headers and footers are typically proprietary corporate assets: business plans, financial projections, legal contracts, or internal audit findings. Uploading these sensitive assets to third-party web conversion servers introduces severe data leakage risks.

2run.tools operates on a strictly client-side architecture. Powered by WebAssembly and isolated Web Workers, all parsing, text layout calculation, font embedding, and PDF stream serialization take place entirely in your browser's private memory space. Your confidential documents are never transmitted across the internet, ensuring 100% compliance with corporate confidentiality standards.

Font Subsetting, Encoding Systems (WinAnsi vs. Identity-H) & CMap Tables

Injecting dynamic typography into existing PDF documents requires rigorous font encoding management. Under ISO 32000, fonts in a PDF can be encoded using legacy simple encodings (such as StandardEncoding, MacRomanEncoding, or WinAnsiEncoding) or composite Type 0 CIDFonts utilizing Identity-H horizontal CMap tables.

If an injection utility naively writes UTF-8 text into a page stream expecting WinAnsi glyphs, special characters like accented letters, smart quotes, em dashes, or foreign currency symbols turn into garbled 'mojibake' rectangles. Our client-side engine embeds proper WinAnsi and Unicode CMap dictionaries alongside each embedded font descriptor, guaranteeing that international dates, author names, and mathematical symbols render with absolute typographic fidelity.

Selective Page Range Application & Cover Exclusions

First impressions matter. Professional publications never display running headers or footers across the front cover, and executive summaries or title pages often omit headers to maintain visual elegance.

Our tool allows you to exclude the first page with a single toggle, or specify custom page ranges (such as `2-100` or `3-25, 28-50`). You can maintain a pristine, unblemished cover design while enforcing consistent corporate framing across all subsequent pages.

💡Pro Tips for Professional Headers and Footers

  • •Use subtle text colors (such as slate gray `#555555`) and modest font sizes (8pt to 10pt) for headers and footers so they provide context without distracting from body content.
  • •Add a thin horizontal separator rule beneath the header or above the footer to cleanly demarcate page margins from body paragraphs.
  • •Combine `{page}` and `{total}` macros in the footer right zone ('Page {page} of {total}') to guarantee document integrity for formal contracts.
  • •Verify your document margins: ensure the header and footer margin settings leave ample clearance so text does not overlap with existing page elements.
  • •If you are stamping corporate classification levels (e.g. 'STRICTLY CONFIDENTIAL'), place it centered in the header in bold crimson or dark blue text for maximum visibility.

🛡️WebAssembly Typography & Vector Stream Compositing

Our header and footer engine operates inside a sandboxed Web Worker utilizing WebAssembly-compiled PDF-Lib. For each page, the engine inspects the `/MediaBox` and `/CropBox` dimensions, extracts page rotation transforms, and establishes an isolated graphics state (`q`). It embeds standard PostScript Type 1 font programs or TrueType subsets, measuring glyph advance widths via character metric tables. Text strings are rendered using text positioning operators (`BT`, `Tf`, `Tm`, `Tj`, `ET`), with horizontal offsets calculated to guarantee left, center, or right alignment with mathematical precision before appending the stream to `/Contents`.

Stack: WebAssembly • Multi-threaded Web Workers • HTML5 Canvas API

Privacy: Files never leave your device or touch a cloud buffer; analytics run only with your consent.

Why choose client-side browser tools?

When you compress an image or merge a PDF on 2run tools, the code executes inside your browser tab using WebAssembly and Web Workers. We never stream your bytes to a remote cloud server. Your private financial reports, personal photos, and legal agreements never leave your device.

Total PrivacyIn-Browser
Instant ProcessingFast RAM
Truly UnlimitedZero Limits

Frequently Asked Questions About PDF Headers and Footers

What dynamic variables can I use in headers and footers?▾

You can use `{page}` for the current page number, `{total}` for total document pages, `{date}` for today's date, `{time}` for current time, and `{filename}` for the original file name.

Can I omit headers and footers from the cover page?▾

Yes! Simply check the 'Skip First Page' option, or specify custom page ranges (e.g., `2-50`) to leave title pages and cover sheets completely unbranded.

Will adding headers or footers shrink or distort my existing content?▾

No! Our tool does not scale, shrink, or re-compress your existing document content. Headers and footers are injected as non-destructive vector text overlays in the designated margin areas.

Can I customize the font, size, and color of the header and footer text?▾

Yes! You can choose from standard fonts (Helvetica, Times, Courier), adjust font sizes from 8pt to 14pt, and pick custom hex colors to match your organization's visual brand identity.

How does the tool handle landscape pages mixed with portrait pages?▾

Our engine inspects the dimensions and `/Rotate` key of every page individually. Headers and footers are placed along the visual top and bottom edges of each sheet regardless of individual page orientation.

Are my sensitive documents uploaded to any remote server?▾

Never. All text layout calculations, font embedding, and file assembly take place 100% locally in your web browser. Your private data never leaves your computer.

Can I add a decorative dividing line between the header and page content?▾

Yes! You can enable a subtle vector divider line beneath the header and above the footer with customizable stroke width and color.

Will headers and footers appear when printing the PDF file?▾

Yes. Because they are injected directly into the PDF content stream, they are permanent vector elements that print crisply on any commercial or desktop printer.

How does the tool ensure headers do not overlap with existing company logos?▾

You can fine-tune vertical margin offsets down to single typographic points (1/72 inch). If your existing letterhead contains a high logo, you can set the header offset to 72 points (1 inch) or higher to position running text safely below the visual branding.

Can I apply different running headers to different chapters or sections?▾

Yes! You can process individual page ranges (e.g. apply 'Chapter 1' to pages 2-15 and 'Chapter 2' to pages 16-30) sequentially, allowing sophisticated publication-grade section formatting.

Sites Loading Under 0.8s
100/100 Lighthouse web engineering
Audit
Dev Arm for Design Agencies
White-label • Bilateral NDA
Partner
Technical SEO by Code
Deep Schema • Zero waste
Scale SEO
Custom Web Apps & SaaS
100% code ownership • Edge scale
Build
Turn Traffic into Sales
+34% sales lift • Fix bottlenecks
Audit