property AttachmentRelationship[Index: Integer]: WString; // read only
PDF 2.0 associated files(ISO 32000-2 §7.11.4)는 각 file specification에 /AFRelationship 이름을 붙여 embedded file이 첨부 대상 콘텐츠와 어떤 관계인지 표시합니다: Source, Data, Alternative, Supplement, EncryptedPayload, FormData, Schema, Unspecified(Table 43). PDF/A-3나 ZUGFeRD / Factur-X invoice가 기계 판독용 XML 페이로드를 표시할 때 이 항목에 의존합니다
이 속성은 네이티브 FPDFAttachment_GetAFRelationship 익스포트를 통해 항목을 읽고 원본 name token을 Unicode 문자열로 반환합니다. file specification에 /AFRelationship 항목이 없거나, 항목이 name이 아니거나, 로드된 pdfium.dll이 이 익스포트보다 오래되었으면(AttachmentRelationshipFeaturesAvailable 참고) 빈 문자열을 반환합니다
이 속성은 읽기 전용입니다. relationship을 지정해 파일을 첨부하려면 같은 name token을 내보내는 FPdfAssocFiles의 Pascal 쪽 라이터를 사용하세요
| Index | Integer. 0 기반 attachment 슬롯. 0 <= Index < AttachmentCount를 만족해야 하며, 그 외 값은 EPdfError(Incorrect attachment index)를 발생시킵니다 |
/EmbeddedFiles 이름 트리에 등록된 첨부에만 인덱스가 있습니다. /AF 배열에서만 참조되는 연관 파일은 이 프로퍼티로 접근할 수 없습니다(AttachmentCount 참고)TPdfAttachmentMetadata의 Relationship 필드에 담아주고, TryGetAnnotationFileAttachment는 file attachment annotation에 대해 대응하는 필드를 채웁니다
var
I: Integer;
begin
Pdf1.LoadFromFile('invoice-facturx.pdf');
for I := 0 to Pdf1.AttachmentCount - 1 do
if Pdf1.AttachmentRelationship[I] = 'Alternative' then
SaveInvoiceXml(Pdf1.AttachmentName[I], Pdf1.Attachment[I]);
end;