DetectFacturXInvoice
文件屬性
描述
檢查目前文件是否含有可識別的電子發票 XML,並從 XMP 與 XML 中繼資料讀取基本識別資訊
語法
Delphi
Function TPDFlib.DetectFacturXInvoice: Integer;
傳回值
| 0 | 找不到可辨識的電子發票 XML |
|---|---|
| 1 | Recognizable e-invoice XML was found |
備註
偵測先用 XMP 的 DocumentFileName 值,接著依序嘗試 factur-x.xml、xrechnung.xml、zugferd-invoice.xml 與 ZUGFeRD-invoice.xml
呼叫成功後,可用 GetFacturXInvoiceInfo 讀取檔名、版本、符合性層級、指引 ID 與 /AFRelationship
範例
// Check whether the loaded PDF carries invoice XML
begin
if PDF.DetectFacturXInvoice = 1 then
InvoiceFileName := PDF.GetFacturXInvoiceInfo(1);
end;
另見
GetFacturXInvoiceInfo, ValidateFacturXInvoice, ExtractFacturXXMLToString