SetEmbeddedFileAFRelationshipA
PDF/UA & accessibilità
Descrizione
Il suffisso A indica l'entry point DLL ANSI (char); l'interfaccia ActiveX/COM espone soltanto la forma Unicode. Il comportamento è identico a SetEmbeddedFileAFRelationship e gli argomenti stringa vengono interpretati usando la code page corrente di SetAnsiMode
Imposta la chiave AFRelationship nel dizionario di specifica del file incorporato. Richiesta da ISO 14289-1 (PDF/UA-1) §7.11 quando in un documento PDF accessibile sono inclusi file incorporati
Sintassi
Delphi
Function DLSetEmbeddedFileAFRelationshipA(InstanceID, Index: Integer; AFRelationship: PAnsiChar): Integer;
DLL
int DLSetEmbeddedFileAFRelationshipA(int InstanceID, int Index, const char * AFRelationship);
Parametri
| Index | Indice con base 1 del file incorporato. Intervallo valido: da 1 a EmbeddedFileCount |
|---|---|
| AFRelationship | Relazione del file incorporato, con distinzione maiuscole: Source — file sorgente Data — dati usati dal documento Alternative — rappresentazione alternativa Supplement — supplemento Unspecified — non specificata, valore predefinito con SetPDFUAMode |
Valore restituito
Restituisce 1 in caso di successo. Restituisce 0 se indice fuori intervallo, AFRelationship non valido o nessun documento aperto.
Note
Quando SetPDFUAMode è attivo, PDF Library for Delphi imposta automaticamente AFRelationship su Unspecified per ogni file incorporato che non contiene già la chiave. Usare SetEmbeddedFileAFRelationship prima del salvataggio per sostituire il valore predefinito con una relazione più specifica
Chiamare questa funzione dopo aver aggiunto il file incorporato e prima di salvare il documento
Esempio
// 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;Vedere anche
SetPDFUAMode, SetPDFAMode, AddFileAttachment, AddEmbeddedFile, EmbedFile, SetEmbeddedFileStrProperty