PDFium Component Docs

SaveAsWithAssociateFiles methode

Component: TPdf  ·  Unit: PDFium
Slaat de actieve PDF op naar een bestandspad en injecteert geassocieerde bestanden in de catalogus of pagina's conform ISO 32000-2 ยง7.11.4

Syntax

function SaveAsWithAssociateFiles(const FileName: string; const Options: TAssocFilesOptions): Boolean;

FileNamestring. The target output file path
OptionsTAssocFilesOptions. Injection options detailing files, metadata, and the target catalog or page attachment point

Return Value

Returns True if the PDF with injected associate files was successfully saved, or False on failure

Description

SaveAsWithAssociateFiles implementeert PDF 2.0 Associate Files-injectie (ISO 32000-2 §7.11.4)

De methode koppelt bestanden zoals XML-gegevens, bronschema's of sjablonen aan de catalogus of afzonderlijke pagina's met expliciete /AFRelationship-metadata

TAssociateFile.Description schrijft de menselijk leesbare bestandsspecificatie-/Desc-waarde die door toegankelijkheids- en discovery-workflows wordt gebruikt

Remarks

Example

var
  Opts: TAssocFilesOptions;
  F: TAssociateFile;
begin
  Opts := TAssocFilesOptions.Default;
  Opts.TargetPage := 0; // catalog-level attachment

  F.FileName := 'data.xml';
  F.Content := GetXmlBytes;
  F.Relationship := afData;
  F.MIMEType := 'text/xml';

  SetLength(Opts.Files, 1);
  Opts.Files[0] := F;

  if Pdf1.SaveAsWithAssociateFiles('output.pdf', Opts) then
    ShowMessage('PDF with associate files saved successfully');
end;

See Also

SaveAsWithAssociateFilesToStream, SaveAs