SetEmbeddedFileAFRelationshipA

PDF/UA & Accessibility

Popis

Koncové A označuje vstupní bod ANSI (char) knihovny DLL; rozhraní ActiveX/COM zpřístupňuje pouze formu Unicode. Chování je shodné s SetEmbeddedFileAFRelationship a řetězcové argumenty jsou interpretovány pomocí aktuální znakové stránky nastavené funkcí SetAnsiMode

Sets the AFRelationship key on the file specification dictionary for an embedded file. Required by ISO 14289-1 (PDF/UA-1) §7.11 when embedded files are included in an accessible PDF document.

Syntaxe

Delphi

Function DLSetEmbeddedFileAFRelationshipA(InstanceID, Index: Integer; AFRelationship: PAnsiChar): Integer;

DLL

int DLSetEmbeddedFileAFRelationshipA(int InstanceID, int Index, const char * AFRelationship);

Parametry

IndexIndex vloženého souboru počítaný od 0. Platný rozsah: 0 až EmbeddedFileCount - 1
AFRelationshipThe relationship of the embedded file to the document. Must be one of the following case-sensitive values:

Source — the embedded file is the source file used to create the document
Data — the embedded file contains data used by the document
Alternative — the embedded file is an alternative representation of the document content
Supplement — the embedded file is supplemental to the document
Unspecified — the relationship is not specified (default when SetPDFUAMode is active)

Návratová hodnota

Vrací 1 při úspěchu. Vrací 0, je-li index mimo rozsah, nemá-li AFRelationship jednu z pěti platných hodnot, nebo není-li otevřen žádný dokument

Poznámky

Je-li aktivní SetPDFUAMode, nastaví PDF Library for Delphi automaticky AFRelationship na Unspecified u každého vloženého souboru, který klíč ještě nemá. Chcete-li toto výchozí chování přebít konkrétnější hodnotou vztahu, použijte před uložením SetEmbeddedFileAFRelationship

Tuto funkci zavolejte po přidání vloženého souboru a před uložením dokumentu

Příklad

// PDF/A-3 archive that embeds an XLSX as the document's source data
var
  FileID: Integer;
begin
  PDF.SetPDFAMode(5);              // PDF/A-3b — allows arbitrary embedded files
  PDF.NewDocument;
  PDF.AddStandardFont('Helvetica');
  PDF.AddPage;
  PDF.PrintText(50, 750, 'Quarterly Sales Report');

  FileID := PDF.AddEmbeddedFile(
    'sales-Q1.xlsx',
    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
  PDF.AddFileAttachment('Source spreadsheet', FileID);

  // Mark the relationship: the spreadsheet is the source of the report
  PDF.SetEmbeddedFileAFRelationship(1, 'Source');

  PDF.SaveToFile('report-PDFA3b.pdf');
end;

Viz také

SetPDFUAMode, SetPDFAMode, AddFileAttachment, AddEmbeddedFile, EmbedFile, SetEmbeddedFileStrProperty