HPDFConvertLoadedToPDFA4Preserving Function

Unit: HPDFArchivalConversion

Convert a loaded document into base PDF/A-4 while retaining original text, vector paths, images, embedded font programs, existing OCR layers, and visible normal annotation or widget appearances

function HPDFConvertLoadedToPDFA4Preserving(Source: THotPDF;
  Destination: TStream; const SRGBProfile: TBytes;
  const Options: THPDFArchivalPreservationOptions;
  out Report: THPDFArchivalPreservationReport): Boolean;

Source must be loaded and exclusively owned during the operation; Destination must be an empty seekable stream at position zero and must not alias the loaded source

SRGBProfile must satisfy the sRGB matrix/TRC archival profile and agree byte-for-byte with any existing decoded output profiles

The function returns true only after serialized output reload, native PDF/A-4 validation, original content and resource verification, and successful staged publication; failure details remain in Report

Existing normal appearances retain their vector resources; missing textual appearances require ASCII values and a compatible native font encoding, while Unicode, hexadecimal, or masked values require an explicit normal appearance

A destination write error triggers a best-effort reset that arbitrary custom streams may reject; use the file function for atomic file publication

See the preservation profile for supported fonts and colors, appearance rules, explicit losses, cumulative stream-work budgets, publication guarantees, and validation limits