Automated Validation Coverage
The 3.56.37 preflight-report update adds a documented automation path on top of the existing PDF/A and PDF/UA-1 file checks. The Delphi PreflightReport demo now covers single-file reports, directory batches, text/JSON/HTML/CSV output, UTF-8 summary CSV files, and plain-text baseline comparison through ComparePreflightReports. Tests.Preflight verifies report sections, machine-readable JSON, standalone HTML, CSV rows, UTF-8 save output, diff lines, and timestamp normalization.
The 3.56.0 through 3.56.25 PDF/UA audit series expands reader and writer diagnostics around PDF/UA-1 metadata, MarkInfo, RoleMap, encryption accessibility permissions, XFA, Reference XObjects, annotation tab order and descriptions, FileSpec names, OCG configuration dictionaries, font embedding and TrueType encoding, heading order, list numbering, Note IDs, media clips, and repeated direct H children. The low-level reader path is exposed through CheckFileCompliance; the writer-side in-memory path is exposed through GetPDFUADiagnostics.
The 3.56.x PAdES validation work adds tests and reference coverage for digest selection, PAdES-B-B authenticated attributes, signing-certificate-v2 IssuerSerial, signature-time-stamp augmentation, DSS/VRI assembly, commitment-type indication, and signature-policy attributes. These checks are covered by the signing tests and by the dedicated PAdES reference pages under Security and Signatures.
The 3.23.0 validation update makes the PDF version-compliance gate strict for PDF 1.2 and adds PDF 1.7 Adobe extension-level checks. PDF 1.2 save targets now reject PDF 1.3+ features such as page TrimBox data before output is written. AESV3, AES-256, RichMedia, Projection, geospatial dictionaries, and ETSI signature subfilters are checked against the required /Extensions /ADBE /ExtensionLevel declaration. Writer entry points that emit those extension-level features now declare the matching ADBE extension level automatically, and append saves run the same preflight as full saves. Tests.Document, Tests.Version, and the C++Builder Tests.VersionCompliance fixture cover strict PDF 1.2 rejection, AES-256 ExtensionLevel output, append-save preflight, and the extension-level SSOT rules.
The 3.20.0 validation update extends the writer-side EnsureMinVersion coverage to eight more PDFlib entry points: SetDocumentMetadata (PDF 1.4 — /Metadata XMP stream), SetPDFAMode (PDF 1.4 — /MarkInfo and /OutputIntents), PageJavaScriptAction (PDF 1.5 — Page /AA), DocJavaScriptAction (PDF 1.4 — Catalog /AA), SetTabOrderMode (PDF 1.5 — Page /Tabs), NewOptionalContentGroup (PDF 1.5 — /Type /OCG), SetNeedAppearances (PDF 1.5 — AcroForm /NeedAppearances), and NewFormField for signature fields (PDF 1.5 — AcroForm /SigFlags AppendOnly bit). Combined with the v3.15.0 and v3.17.0 entries, PDFlib now auto-bumps FVersion across twenty-one writer entry points. NewOptionalContentGroup previously bumped FVersion directly, bypassing EnsureMinVersion and LockSaveVersion; it now routes through the proper path so the lock is honored and the bump appears in AutoBumpedFeatures. Tests.Document covers six new auto-bump cases (SetDocumentMetadata 1.3 → 1.4, SetTabOrderMode 1.3 → 1.5, SetPDFAMode 1.3 → 1.4, NewOptionalContentGroup 1.3 → 1.5, SetNeedAppearances 1.3 → 1.5, NewFormField signature 1.3 → 1.5).
The 3.19.0 validation update implements four previously deferred SSOT rules. The Btn-field /Ff bit 15 NoToggleToOff flag (mask 16384) gates radio-button-only behavior to PDF 1.4 and discriminates on /FT = 'Btn'. The DeviceN /Subtype /NChannel rule recognizes the PDF 1.6 NChannel color-space refinement encoded on the attributes dictionary at index 4 of the DeviceN array. The FontFile3 /Subtype /OpenType rule recognizes PDF 1.6 OpenType font programs when the stream is reached through a parent key named 'FontFile3'. The Sig /SubFilter ETSI rule fires on signature dictionaries with /SubFilter ETSI.CAdES.detached or /SubFilter ETSI.RFC3161, both PDF 1.7. This is the first SSOT callback set that relies on Ctx.KeyName context awareness. Tests.Version asserts all four rules are present with the correct MinVersion. Rule count grew from 99 to 103.
The 3.18.6 validation update adds context-sensitive /AA (additional actions) rules. /AA appears in four PDF dictionary containers with different minimum versions: Catalog /AA (document-level triggers, PDF 1.4), Annot /AA (annotation triggers, PDF 1.4), Page /AA (page triggers, PDF 1.5), and Form field /AA (PDF 1.2, valid under strict PDF 1.2 targets). Three new fmkCustom callbacks discriminate by /Type, so /AA only fires the rule that matches the container it sits on. Widget annotation /AA (a form field that is also a /Subtype /Widget annotation) intentionally fires the Annot /AA branch at PDF 1.4; this is an accepted approximation because every save contract from PDF 1.4 upward already accepts form-field /AA. Tests.Version asserts all three contextual /AA rules are present. Rule count grew from 96 to 99.
The 3.18.5 validation update fixes a /Tabs rule misclassification and adds a /NeedAppearances rule. /Tabs (page tab order) was previously listed at PDF 1.4 in PDFFeatureRules but the Adobe PDF 1.4 changes specification (Technical Note #5409) does not introduce /Tabs; the entry is first introduced in PDF 1.5 Table 8.10 (Page Object). The rule now lives in the PDF 1.5 section. A new rule covers AcroForm /NeedAppearances (PDF 1.5 Table 218), which had no representation in the table before this update. Tests.Version asserts /Tabs has no PDF 1.4 entry and that the /NeedAppearances PDF 1.5 rule is present. Rule count grew from 95 to 96.
The 3.18.1 validation update extends the bit-level rule set with seven form-field /Ff flag callbacks and the AcroForm /SigFlags AppendOnly bit. Tx FileSelect (1048576), Ch MultiSelect (2097152), Tx/Ch DoNotSpellCheck (4194304) and Tx DoNotScroll (8388608) gate to PDF 1.4; Tx Comb (16777216), Tx RichText / Btn RadiosInUnison (33554432), Ch CommitOnSelChange (67108864) and AcroForm SigFlags AppendOnly (mask 2) gate to PDF 1.5. /Parent inheritance is not followed — only dictionaries that explicitly carry /Ff or /SigFlags trigger the rules. Tests.Document covers a Tx /Ff 16777220 fixture (Comb + NoExport) bumping the loader from 1.4 to 1.5 and listing Comb in ContributorFeatures.
The 3.18.0 validation update starts adding sub-key and bit-level rules to PDFFeatureRules. Three bit-level annotation flag rules cover the /F mask values for Locked (128, PDF 1.4), ToggleNoView (256, PDF 1.5), and LockedContents (512, PDF 1.7); they fire only when the dictionary is /Type /Annot. Six new fmkDictKey rules cover distinctive catalog and page sub-keys: /BoxColorInfo (PDF 1.4), /Permissions, /Legal and /PresSteps (PDF 1.5), /VP (PDF 1.6), and /Collection (PDF 1.7). Tests.Document covers an Annot /F 516 fixture (Print + LockedContents) bumping the loader from 1.4 to 1.7 and listing LockedContents in ContributorFeatures. Tests.Version asserts the new rules are in the table.
The 3.17.0 validation update extends the writer-side EnsureMinVersion coverage to eight more PDFlib entry points: AddLinkToJavaScript, SetOpenActionJavaScript, AddGlobalJavaScript, and FormFieldJavaScriptAction (all PDF 1.3); AddEmbeddedFile and AddFileAttachment (PDF 1.3); SetXFAFromString (PDF 1.5); AddSWFAnnotationFromFile (PDF 1.7). Combined with the original v3.15.0 entries (SetTransparency, SetPageUserUnit, Encrypt, SetPageLayout), PDFlib now auto-bumps FVersion across thirteen high-version writer entry points. Tests.Document covers the JavaScript triplet (AddGlobalJavaScript, SetOpenActionJavaScript, AddLinkToJavaScript) auto-bumping a fresh document from PDF 1.2 to PDF 1.3.
The 3.16.3 validation update adds an opt-in version lock. New PDFlib API LockSaveVersion(Version) pins FVersion at Version and stops Phase 3 writer-side EnsureMinVersion from raising it; UnlockSaveVersion clears the lock. The save-time gate is unchanged, so a locked document that picks up a higher-version feature through a writer call still fails the save with LastErrorCode 602. Tests.Document covers (a) lock at 1.3 + SetTransparency: FVersion stays at 1.3, AutoBumpedFeatures stays empty, SaveToFile fails with LastErrorCode 602; (b) lock at 1.6 + SetTransparency / SetPageUserUnit: both calls succeed without bumping FVersion further; (c) lock + SetTransparency (refused) + Unlock + SetTransparency (allowed): FVersion bumps to 1.4 and AutoBumpedFeatures records "transparency".
The 3.16.2 validation update adds a contributor-only view of load-time feature detection. CollectMatchesForObject and DetectFeaturesInObjectTree now take a BaselineVersion parameter so callers can split matched features into "every match" (DetectedFeatures, GetInformation 101) and "matches whose MinVersion is strictly above the baseline" (ContributorFeatures, GetInformation 103). TPDFDocument.DetectVersionFromContent feeds the file HeaderVersion as the baseline so ContributorFeatures answers "why is the effective version higher than the literal file header?". Tests.Document covers a fixture that lists /CA in DetectedFeatures but produces empty ContributorFeatures (no rule pushed above the 1.4 header), and a combined fixture where only /UserUnit (1.6) appears in ContributorFeatures while /TrimBox (1.3) and /StructTreeRoot (1.4) are filtered out.
The 3.16.1 validation update broadens loader-side detection coverage with six additional synthetic fixtures and tests: an in-page transparency ExtGState (PDF 1.4 feature with no bump because the header is already 1.4), a Catalog /MarkInfo entry that bumps PDF 1.3 to PDF 1.4, an /OCProperties + OCG content set that bumps PDF 1.4 to PDF 1.5, a /Type /3DStream object that bumps PDF 1.5 to PDF 1.6, a multi-feature combination fixture that confirms FVersion reflects the highest required minimum and DetectedFeatures lists every contributing entry, and a snapshot-stability check that confirms post-load writer auto-bumps land in AutoBumpedFeatures while DetectedFeatures stays on the load-time snapshot.
The 3.16.0 validation update completes the PDF version-compliance plan with loader-side detection. After LoadFromString / LoadFromFile / LoadFromStream, TPDFDocument.DetectVersionFromContent walks every indirect object through the SSOT and bumps FVersion above the literal %PDF-X.Y header value when content requires a higher version. Three new GetInformation keys (100 = HeaderVersion, 101 = DetectedFeatures, 102 = AutoBumpedFeatures) expose the loader and writer diagnostics. Tests.Document covers a synthetic PageUserUnitFixture (header 1.4, page /UserUnit 2.0) that the loader bumps to 1.6 while preserving HeaderVersion 1.4, plus a fresh-document case that confirms the diagnostic GetInformation keys are empty before any load happens.
The 3.15.0 validation update wires PDFlib writer entry points (SetTransparency, SetPageUserUnit, Encrypt with AES strengths, SetPageLayout two-page modes) through TPDFDocument.EnsureMinVersion so that calling a high-version feature at a low SetInformation save target now auto-bumps the document version instead of producing LastErrorCode 602 at save time. Tests.Document covers the new "set 1.3, SetTransparency, FVersion becomes 1.4 and save writes %PDF-1.4" path, the equivalent paths for SetPageUserUnit and Encrypt(AES-256), and the no-op case where the caller already picked a version that satisfies the writer's minimum.
The 3.14.3 validation update closes out Phase 2 of the version-compliance work by adding the remaining PDF 1.6 3D dictionary types (/Type /3DStream /3DRef /3DBackground /3DRenderMode /3DLightingScheme /3DCrossSection /3DNode) and the PDF 1.7 Redact and RichMedia and Projection annotation subtypes along with the /Type /Requirement and /ReqHandler companion dictionaries. With this PATCH the SSOT now covers PDF 1.3 through 1.7 chapter-level features in a single feature-to-minimum-version table.
The 3.14.2 validation update extends the version-compliance rule set to recognize PDF 1.5 features: /XFA forms, /AlternatePresentations, /Renditions name tree, the /Type /Rendition /MediaCriteria /MediaPermissions /MediaPlayers multimedia dictionaries, and the Screen annotation subtype.
The 3.14.1 validation update extends the version-compliance rule set to recognize PDF 1.4 features: /StructTreeRoot, /MarkInfo and StructElem dictionaries (tagged PDF), the page /Tabs and document /Lang entries, /StructParent and /StructParents references, /OutputIntents and /OutputIntent dictionaries, the /UR3 usage-rights signature, and the PDF 1.4 annotation subtypes Polygon, PolyLine, Caret, Ink, Popup, and Watermark. Tests.Document covers the new "save as PDF 1.3 rejects /StructTreeRoot" and "save as PDF 1.4 keeps /StructTreeRoot" paths.
The 3.14.0 validation update extends the version-compliance rule set to recognize PDF 1.3 features (smooth shading and function dicts, ICCBased and DeviceN color spaces, TrimBox/BleedBox/ArtBox page entries, /ToUnicode CMaps, file attachment / Sound / Movie annotations, /Type /Filespec and /Type /EmbeddedFile dicts, /Group /EF /Alternates /Mask keys, and JavaScript actions). Version 3.23.0 supersedes the earlier PDF 1.2 compatibility tolerance with a strict PDF 1.2 gate. Tests.Document now covers strict PDF 1.2 rejection for PDF 1.3 TrimBox data and locked append-save version preflight.
The 3.13.0 validation update keeps the same out-of-version save rejection behavior as 3.12.7 (LastErrorCode 602) while moving the rule set into a dedicated Lib\PDFlibVersion.pas unit and adding a Tests.Version DUnitX fixture that asserts the rule table contains the v3.12.6 baseline rules and that the version-string helpers round trip correctly.
The 3.12.0 validation matrix includes build-zlib-bcc32, build-zlib-bcc64x, build-zlib-vc64, build-jpeg-bcc32, and build-jpeg-vc64, each completing with zero failed objects. Library package builds were also verified with build-Win32-Lib.cmd 37.0 and build-Win64-Lib.cmd 37.0.
The current Delphi DUnitX suites passed 362 of 362 tests on Win32 and 362 of 362 tests on Win64. Covered areas include compression round trips, known zlib stream decoding, boundary-sized payloads, stored multi-block streams, HelloWorld /FlateDecode output, JPEG and PNG rendering, image import and export, fonts, forms, encryption, decryption, signing, PAdES attributes, printing, Unicode helpers, buffers, canvas drawing, pages, tables, document workflows, syntax/xref parsing, strict PDF 1.2 save contracts, append-save version preflight, PDF 1.7 extension-level compliance, PDF/UA diagnostics, and preflight report generation/comparison.
The current C++Builder Win64x GoogleTest suite passed 61 tests and skipped 2 existing sample-dependent tests. It covers demo-derived workflows plus zlib-ng known streams, boundary-sized payloads, PNG-like scanline payloads, stored multi-block round trips, image handling, render output including direct-access PdfToImage coverage, encryption, signing, printing, strict PDF 1.2 save contracts, PDF 1.7 extension-level output, append-save version preflight, and HelloWorld compressed-output checks, which validates the bcc64x zlib-ng object set through the C++Builder ABI.
The HTML reference is guarded by tools/test_docs_api_coverage.py, which checks that every public TPDFlib function has an English reference page, and by tools/test_docs_navigation.py, which keeps multilingual changelog navigation targets consistent in the framed help shell.
Readme.html and the HTML reference should be kept aligned when user-visible validation, preflight, rendering, signing, or report behavior changes.