Skip to content
getnextpdf.com

Pro edition

Legal

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.

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.

Terminal window
composer require nextpdf/pro:^3

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 example CASE-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 own q/Q save/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.

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.

ClassResponsibility
BatesNumberConfigImmutable appearance, numbering, and position settings.
BatesNumbererGenerate per-page content-stream fragments.
BatesPositionPredefined corner positions with edge inset.
use NextPDF\Pro\Legal\BatesNumberer;
$streams = BatesNumberer::generate(
pageCount: 50,
pageSizes: $pageSizes,
prefix: 'EX-',
);
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);
  • The number of returned fragments matches the page count; a mismatched pageSizes length 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.

Generation is linear in page count. Each fragment is small and independent.

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.

BehaviorReferenceStatus
Optional content groups (toggleable layer)ISO 32000-2 §8.11Aligned (paraphrased)

This table records the specification NextPDF Pro is built against.

  • BatesNumberConfig is 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.
  • BatesNumberer returns one self-contained content-stream fragment per page, each with its own q/Q save/restore so it appends without disturbing other page graphics. The number of fragments matches the page count; a mismatched pageSizes length fails fast.
  • BatesPosition provides 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 does not change Legal behavior. Enterprise adds higher-tier compliance and signature features documented separately; they are not required for Bates numbering.

There is no Core equivalent for configurable Bates numbering. This is a Pro addition.

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.