PDFium Delphi Component Docs

AttachmentRelationship プロパティ

コンポーネント: TPdf  ·  ユニット: PDFium
指定した 0 基準インデックスの埋め込みファイルの /AFRelationship 名を返します。file specification がこのエントリを持たない場合は空文字列を返します

構文

property AttachmentRelationship[Index: Integer]: WString; // read only

説明

PDF 2.0 の associated file(ISO 32000-2 §7.11.4)では、各 file specification に /AFRelationship 名が付きます。これは埋め込みファイルが添付先のコンテンツとどう関係するかを示すもので、Source、Data、Alternative、Supplement、EncryptedPayload、FormData、Schema、Unspecified のいずれかです(Table 43)。PDF/A-3 や ZUGFeRD / Factur-X のインボイスは、機械可読な XML payload を示すためにこのエントリに依存しています

このプロパティはネイティブの FPDFAttachment_GetAFRelationship エクスポート経由でエントリを読み取り、名前トークンをそのまま Unicode 文字列として返します。file specification に /AFRelationship エントリがない場合、エントリが name ではない場合、読み込んだ pdfium.dll がこのエクスポートより古い場合(AttachmentRelationshipFeaturesAvailable を参照)は空文字列を返します

このプロパティは読み取り専用です。relationship を指定してファイルを添付するには、同じ名前トークンを出力する FPdfAssocFiles の Pascal 側ライターを使ってください

パラメーター

IndexInteger. 0 基準の添付ファイルスロットです。0 <= Index < AttachmentCount を満たす必要があり、範囲外の値では EPdfError(Incorrect attachment index)が発生します

備考

例

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;

関連項目

AttachmentName, AttachmentType, AttachmentDescription, ReadAttachmentMetadata, AttachmentRelationshipFeaturesAvailable