Native page imports and preserved PDF/A-4

Append selected pages with their original text and vector content streams, inherited MediaBox/CropBox/Rotate, explicit UserUnit, embedded fonts, images, shared resources and cyclic indirect identities

AppendImportedPages operates on two distinct loaded documents, preserves the destination revision and encryption, and stages all imported objects before committing the page tree; duplicate selection, invalid references, cancellation, permissions and byte/object/page budgets leave the destination unchanged

Selected source annotations become ordinary Form XObject content using their normal appearance state, BBox and Matrix; source interactions and fields are not imported, hidden annotations are removed, and flattenAnnotations=false explicitly removes all source annotations

Visible annotations require usable normal appearances; NoZoom/NoRotate geometry requires another editing policy, and signed or certified destination documents require a separate signed-document policy

Source user passwords must grant text extraction, and destination user passwords must grant content modification; owner authentication bypasses these permission restrictions

Verified preservation

HPDFConvertHeadlessToPDFA4PreservingFile creates an independent PDF 2.0 document with actual sRGB output intent and PDF/A-4 XMP, imports original content and flattened appearances, validates the staged candidate with the genuine veraPDF CLI, and publishes only compliant output atomically

The conversion removes original encryption, interactive fields, signatures, catalog actions, document metadata and catalog attachments whilst preserving reachable page content/resources; allowSignatureInvalidation must be explicit when the source contains signed fields

The default path preserves original font programs; explicit font repair adds bounded normalisation and embedding of available substitutes for missing fonts, and every final candidate still requires genuine PDF/A-4 validation before replacing the destination

Validator configuration

Install headless Java and the official veraPDF CLI JAR, then set HOTPDF_VERAPDF_JAR or configure ValidatorJAR in Pascal; the default paths are /usr/bin/java and /opt/hotpdf-verapdf/cli.jar

Validation uses separate process arguments, headless Java, a configured heap limit, bounded stdout/stderr, a time budget and cancellation; timeout/cancellation terminates and reaps the child process and removes private staging files

The managed preparation and Java heap limits do not represent an operating-system RSS cap

Callback operations

{"schemaVersion":1,"type":"pages.import","pages":[2,0,1],"sourcePassword":"source-owner","flattenAnnotations":true}
{"schemaVersion":1,"type":"pdfa.convert","profile":"PDF/A-4","mode":"preserve"}

pages.import requires a loaded destination handle and a separate source InputIO; destination authentication stays with the handle, and sourcePassword applies only to the imported input

pdfa.convert defaults to raster; preserve keeps text/vector content and invokes veraPDF before output callbacks, then replaces the handle with the verified unencrypted document only after successful output and result publication

Acceptance

Native Linux FPC 3.2.2 and 3.3.1 verify original stream/font/CMap bytes, inherited resources, rotations, AES source/destination revisions, transformed appearances, cyclic resources, reload behaviour, rollback, actual PDF/A-4 validation and bounded child lifetime; Windows FPC and Delphi exercise page imports, and both C++Builder architectures compile the public headers

sh Tests/Linux/Run-HeadlessPageImportAcceptance.sh
sh Tests/Linux/Run-LinuxABIAcceptance.sh

Page import and preserved archival contracts · Native document workflows