Add Page Numbers to PDF Vector Bates Stamping
Insert headers, footers, and Bates numbers with custom positions, fonts, colors, and formatting templates. 100% private in-browser stamping.
Comprehensive Technical Guide: PDF Text Geometry, Typography & Bates Stamping
Paginating a PDF document or affixing legal Bates numbering is fundamentally different from adding page numbers in a word processor. In applications like Microsoft Word or Google Docs, pagination occurs within a dynamic flow layout engine where reflow occurs automatically. In contrast, the Portable Document Format (PDF) is a fixed-layout coordinate representation where every glyph, line, and image is locked onto an absolute coordinate plane.
1. Coordinate Spaces: Origin and Baseline Metrics
In accordance with ISO 32000-1, the standard PDF User Space defines the origin coordinate (0, 0) at the bottom-left corner of the page boundary, rather than the top-left used in web browsers and operating system windowing environments:
Xcoordinate increases positively toward the right edge.Ycoordinate increases positively upward toward the top edge.
When drawing text strings via the PDF operator Tj inside a text object (BT ... ET block), the coordinate supplied designates the typographic baseline of the first character, not its bounding box top-left corner:
BT
/F1 10 Tf
1 0 0 1 306 30 Tm
(Page 1 of 12) Tj
ET
To align page numbers horizontally (such as Center or Right alignment), the stamping engine must calculate the exact string advance width using font metric tables before invoking the text matrix operator Tm:
x_center = (page_width - font.widthOfTextAtSize(text, fontSize)) / 2
2. Rotation Inheritance and Coordinate Transformations
A frequent defect of simplistic PDF pagination tools is that page numbers appear sideways or upside down on landscape pages or scanned documents. This happens because the page's visible content is transformed by an internal /Rotate attribute (e.g., 90, 180, or 270 degrees).
QuickCoderHub dynamically inspects the rotational angle of each individual page. When stamping a page with /Rotate 90, the mathematical origin shifts from the physical bottom-left to the top-left, and the horizontal and vertical axes swap roles. Our engine applies compensatory coordinate projection so that headers and footers always align upright relative to the human reader's orientation.
| Page Orientation | Raw /Rotate | Bottom-Center Calculation | Visual Result |
|---|---|---|---|
| Portrait | 0° | x = (W - textW) / 2, y = margin |
Bottom-center footer |
| Landscape CW | 90° | x = margin, y = (H - textW) / 2 |
Compensated upright footer |
| Inverted Portrait | 180° | x = (W - textW) / 2, y = H - margin |
Compensated upright footer |
| Landscape CCW | 270° | x = W - margin, y = (H - textW) / 2 |
Compensated upright footer |
3. Standard 14 PDF Type 1 Fonts
To ensure guaranteed cross-platform compatibility across all mobile devices, enterprise printers, and legacy PDF readers without bloating file size, QuickCoderHub utilizes the standardized PDF Core 14 Fonts:
- Helvetica Family: Clean modernist sans-serif ideal for business reports, contracts, and academic submissions.
- Times-Roman Family: Elegant serif font matching traditional publishing, legal briefs, and formal manuscripts.
- Courier Family: Monospaced typewriter font standard in technical specifications, software source listings, and Bates numbering.
Because these 14 fonts are guaranteed to be natively present in every conforming PDF renderer, no font subsets need to be embedded, adding less than 1 KB of metadata to your final document.
Frequently Asked Questions
- Can I skip numbering the title or cover page of my document?
- Yes. In the "Apply To Pages" input field, you can specify ranges such as
2-(which numbers page 2 to the end, leaving page 1 blank) or custom ranges like2-10. - What is Bates Stamping and can I use it for legal discovery?
- Bates numbering is an indexing technique used in legal, medical, and corporate discovery to assign unique identification numbers to each page. By choosing the "Bates: {n}" template or custom prefixing (e.g.
ACME-00{n}), you can generate legally compliant discovery packages. - Does adding page numbers overwrite existing text or graphics?
- No. Page numbers are stamped onto a new content stream layer placed at custom margin coordinates (default 30pt inset). Your original document text, tables, and images remain completely untouched and vector-sharp.
- Are my files sent to any external server during stamping?
- Never. All PDF parsing, canvas rendering, and binary font vector stamping executes 100% locally in your web browser memory using client-side JavaScript. Your data remains completely private.