Native Linux archival font repair

Native text/vector PDF/A-4 conversion can explicitly normalize missing fonts through a configured Ghostscript pdfwrite process, retain searchable text and vector paths, and validate the final native archival document with the official veraPDF CLI before publication

Callback ABI

{"schemaVersion":1,"type":"pdfa.convert","mode":"preserve","profile":"PDF/A-4","fontRepair":true,"maxFontRepairMilliseconds":120000}

fontRepair defaults to false; setting it to true explicitly permits font substitution according to the installed Ghostscript font configuration and returns fontRepairPerformed true after successful normalization

The response also includes textAndVectorsPreserved, validationSucceeded, pageCount and the existing removed-field, signature and annotation counts; successful publication replaces the handle with the verified unencrypted archival document

Pascal configuration

Options := THPDFHeadlessArchivalPreservationOptions.Default;
Options.FontRepair := True;
Options.GhostscriptExecutable := '/usr/bin/gs';
Options.MaxFontRepairMilliseconds := 120000;
Report := HPDFConvertHeadlessToPDFA4PreservingFile(Document, Destination, Options);

GhostscriptExecutable selects the normalization executable, JavaExecutable and ValidatorJAR select the genuine validator, and CancellationToken applies to resource traversal, text checks, normalization and validation

Processing and limits

The converter first imports source page resources and flattens eligible annotation appearances into a private native document, so authenticated AES inputs are decrypted through the document reader and original page permissions still apply

Ghostscript receives an argument vector with SAFER enabled, a prepress baseline, PDF 2.0 output, font embedding and explicit image downsampling overrides; bounded resource traversal collects font names into hexadecimal PostScript names and an explicit AlwaysEmbed list for older Ghostscript versions

The normalization process runs through /usr/bin/prlimit with an address-space limit from MaxWorkingBytes and a file-size limit from MaxOutputBytes; its output and diagnostics have byte limits, and MaxFontRepairMilliseconds bounds elapsed processing time

Normalized pages must retain the original page count and extracted character sequence, allowing line and whitespace layout changes and additional flattened appearance text; the converter then imports them into a fresh native PDF/A-4 template with sRGB output intent, XMP and document identifiers

The final candidate must pass the official configured veraPDF PDF/A-4 validation before fsync and atomic rename; an unavailable backend, changed text, invalid output, exceeded budget, timeout or cancellation leaves the destination intact and cleans private staging files

Timeout and cancellation terminate, kill when necessary, and reap the direct normalization process; subprocess executables should run directly rather than through a shell or a wrapper that creates unrelated descendants

Runtime and fidelity

Font repair requires Ghostscript, its installed substitute fonts and util-linux prlimit; preservation validation requires a headless Java runtime, the official veraPDF CLI JAR and Little CMS 2 for native sRGB profile generation

Substituted fonts can change glyph outlines and layout; an available original font is preferable when exact appearance matters, and explicit font repair does not promise byte-identical page resources or retained signatures

Signed inputs require AllowSignatureInvalidation true, source/output aliases are rejected, and visible annotations still need a usable normal appearance before flattening

Independent acceptance covers 12 standard Latin font faces and an unembedded Arial TrueType font across plain, AES R5 and AES R6 inputs, rotated pages, actual embedded font programs, searchable accented text, retained vector paths, pixel fidelity and genuine PDF/A-4 validation

Page imports and preservation · Native callback ABI · Native workflows