On open, detects two Adobe-tripping markers in the source: a legacy
/Version /X.Y pin in the catalog, or a fragmented xref with multiple subsections. If either is present, runs the source through Ghostscript's pdfwrite+PDF/A-2b pass BEFORE signing to produce a clean, contiguous, Adobe-friendly structure. Fixes the "document has been modified" rejection Adobe throws on Office/Word-generated PDFs (Ayush.pdf-style sources) while other validators say the signature is fine. When the source already looks clean (most machine-generated PDFs), Ghostscript is never loaded — the detection is cheap and the CDN pull only happens on documents that actually need it.
Ghostscript-WASM (~5 MB gzipped) is loaded on demand from jsDelivr the first time you sign a PDF that needs it — no local install. It's
AGPL-3.0, upstream Artifex build, unmodified; pdf-signer itself stays MIT. Turn off if you don't want the runtime CDN dependency.