function SaveAsPdfA(const FileName: string; Conformance: TPdfAConformance = pac1b): Boolean; overload;
function SaveAsPdfA(const FileName: string; const Options: TPdfASaveOptions): Boolean; overload;
SaveAsPdfA realiza primero el SaveAs normal y después
superpone una actualización incremental sobre los bytes guardados que promociona el
archivo a un archivo PDF/A (PDF/A-1b por defecto; ISO 19005-1, con Cor.1:2007). El
posprocesado inyecta cuatro cosas en el flujo guardado:
pdfaid:part = 1, pdfaid:conformance = B), mirrors every Document Information Dictionary entry into its XMP equivalent (Title → dc:title, Author → dc:creator, Subject → dc:description, Keywords → pdf:Keywords, Creator → xmp:CreatorTool, Producer → pdf:Producer, CreationDate → xmp:CreateDate, ModDate → xmp:ModifyDate) as required by ISO 19005-1 6.7.3, and embeds the pdfaid extension schema description required by 6.7.8 / Cor.1.TPdfASaveOptions.IccProfileData./ID array in the trailer (mandatory per ISO 19005-1 6.1.3). When the source PDF already carries a file identifier, the existing 16-byte permanent and changing IDs are reused; otherwise a deterministic 16-byte fallback ID is derived from the source bytes.La salida permanece idéntica en bytes al resultado base de SaveAs hasta el
final del PDF original; solo se añade la actualización incremental. Los lectores que no
entienden PDF/A siguen renderizando el archivo exactamente como lo haría el SaveAs
normal. Las dos sobrecargas difieren solo en cómo se pasan la conformidad / las opciones
— la forma TPdfAConformance es un atajo para el caso común
(pac1b); la forma TPdfASaveOptions toma un registro con toda la
superficie de configuración, incluidas anulaciones opcionales para Title, Author, Subject,
Keywords, Creator, Producer, CreationDate, ModDate, DocumentId e InstanceId. Los campos
que se dejan vacíos se autocompletan desde FPDF_GetMetaText /
FPDF_GetFileIdentifier, así que el llamador típico no necesita fijar ningún
campo salvo Conformance
El valor Conformance selecciona el estándar y nivel de destino. PDF/A-1
(ISO 19005-1) ofrece pac1b y pac1a; PDF/A-2 (ISO 19005-2) y
PDF/A-3 (ISO 19005-3) añaden los niveles b, u y a como pac2b /
pac2u / pac2a y pac3b / pac3u /
pac3a. El pdfaid:part inyectado (1, 2 o 3) y
pdfaid:conformance (A, B o U) siguen el valor solicitado, mientras que el
OutputIntent mantiene el subtipo GTS_PDFA1 que ISO 19005-2
conserva para cada parte. Como el posprocesador no puede sintetizar estructura lógica, una
petición de nivel A (pac1a / pac2a / pac3a) se
degrada automáticamente al nivel B correspondiente cuando la fuente carece de la
estructura PDF etiquetada que ese nivel requiere — así el archivo guardado nunca hace
una afirmación falsa de nivel A
Devuelve True si tiene éxito. Devuelve False si
the base SaveAs failed, if the incremental update could not be
attached (PDF too short, invalid trailer), or if the ICC profile
data was provided but failed validation.
/Encrypt key. (Internally the base save runs with saRemoveSecurity.)ValidatePdfA after the save to inspect the result and surface any remaining issues to operators.
// Simple PDF/A-1b output using the bundled sRGB profile
if Pdf1.SaveAsPdfA('C:\Report.pdfa.pdf') then
ShowMessage('Saved PDF/A-1b');
// With a custom ICC profile
var
Opts: TPdfASaveOptions;
begin
Opts := Default(TPdfASaveOptions);
Opts.Conformance := pac1b;
Opts.IccProfileData := TFile.ReadAllBytes('C:\Profiles\Coated.icc');
Pdf1.SaveAsPdfA('C:\Report.cmyk.pdfa.pdf', Opts);
end;