Pro edition
Legal
At a glance
Section titled “At a glance”NextPDF Pro applies sequential Bates numbering to document pages as configured. It generates self-contained PDF content-stream fragments with configurable prefix, suffix, padding, position, and an optional toggleable content layer.
Availability & licensing
Section titled “Availability & licensing”This capability ships in NextPDF Pro (nextpdf/pro) and activates with a Pro-tier license envelope. A deployment without that entitlement does not load the capability’s classes. Compare editions and get a license.
Install
Section titled “Install”composer require nextpdf/pro:^3Conceptual overview
Section titled “Conceptual overview”Bates numbering stamps a sequential identifier on each page, commonly used to track pages through a document-production process. NextPDF Pro provides:
BatesNumberConfig— an immutable configuration value object. You set the prefix (for exampleCASE-2024-), suffix, start number, zero-padding width, font family and size, opacity, position, edge inset, and whether to place the marks on an optional content layer.BatesNumberer— the engine. Given a page count and per-page sizes, it returns one self-contained content-stream fragment per page. Each fragment carries its ownq/Qsave/restore, so it appends to an existing page’s content without disturbing other graphics.BatesPosition— an enum of six predefined corner positions, each with a configurable inset from the page edge. The enum computes coordinates in PDF-native space (origin at bottom-left).
The optional content layer lets a viewer toggle the Bates marks on or off, which keeps the underlying page content unmodified.
NextPDF Pro applies Bates numbering exactly as you configure it. The numbering scheme, retention, and any evidentiary handling are your responsibility and your legal team’s.
Why it works this way
Section titled “Why it works this way”The load-bearing decision is that BatesNumberer emits one self-contained content-stream fragment per page rather than editing the page in place. Each fragment wraps its drawing in its own q/Q save and restore, optionally inside an OCG BDC/EMC marked-content layer. So the stamp appends onto a page without disturbing the graphics already there, and the underlying page bytes stay untouched. That non-destructive posture makes the marks reversible: a viewer can toggle the layer off and recover the original page. It also keeps each page independent. Numbering stays linear in page count, and one page’s stamp cannot corrupt another’s.
Design background: Incremental updates and why they matter.
API surface
Section titled “API surface”| Class | Responsibility |
|---|---|
BatesNumberConfig | Immutable appearance, numbering, and position settings. |
BatesNumberer | Generate per-page content-stream fragments. |
BatesPosition | Predefined corner positions with edge inset. |
Code sample — Quick start
Section titled “Code sample — Quick start”use NextPDF\Pro\Legal\BatesNumberer;
$streams = BatesNumberer::generate( pageCount: 50, pageSizes: $pageSizes, prefix: 'EX-',);Code sample — Production
Section titled “Code sample — Production”use NextPDF\Pro\Legal\BatesNumberConfig;use NextPDF\Pro\Legal\BatesNumberer;use NextPDF\Pro\Legal\BatesPosition;
$config = new BatesNumberConfig( prefix: 'CASE-2024-', suffix: '-CONFIDENTIAL', padding: 6, position: BatesPosition::BottomRight, useLayer: true,);$streams = (new BatesNumberer($config))->generateStreams($pageCount, $pageSizes);Edge cases & gotchas
Section titled “Edge cases & gotchas”- The number of returned fragments matches the page count; a mismatched
pageSizeslength fails fast. - The configured font family must be available in the font registry.
- Opacity and layer toggling rely on optional content support in the consuming viewer.
Performance
Section titled “Performance”Generation is linear in page count. Each fragment is small and independent.
Security notes
Section titled “Security notes”Bates marks are overlay content. They do not redact, encrypt, or otherwise alter the underlying page data. Use the Security module for redaction or access control.
Conformance
Section titled “Conformance”| Behavior | Reference | Status |
|---|---|---|
| Optional content groups (toggleable layer) | ISO 32000-2 §8.11 | Aligned (paraphrased) |
This table records the specification NextPDF Pro is built against.
Behavior contract
Section titled “Behavior contract”BatesNumberConfigis an immutable value object for prefix, suffix, start number, zero-padding width, font family and size, opacity, position, edge inset, and the optional-content-layer toggle.BatesNumbererreturns one self-contained content-stream fragment per page, each with its ownq/Qsave/restore so it appends without disturbing other page graphics. The number of fragments matches the page count; a mismatchedpageSizeslength fails fast.BatesPositionprovides six predefined corner positions computed in PDF-native space (origin bottom-left) with a configurable edge inset.- Bates marks are overlay content. They do not redact, encrypt, or alter underlying page data.
- The module applies Bates numbering exactly as configured.
Enterprise boundary note
Section titled “Enterprise boundary note”Enterprise does not change Legal behavior. Enterprise adds higher-tier compliance and signature features documented separately; they are not required for Bates numbering.
Core fallback / alternative
Section titled “Core fallback / alternative”There is no Core equivalent for configurable Bates numbering. This is a Pro addition.
Publication boundary
Section titled “Publication boundary”This page documents externally observable behavior and the supported public API surface only. Internal namespace paths, helper classes, mechanism tables, runbook filenames, and ticket prefixes are out of scope.
See also
Section titled “See also”- Merge — assemble production sets before numbering.
- Security — redaction and access control.
- Legal — Deep Reference — full API contract and behavior details.