DetectFacturXInvoice
文档属性
说明
检查当前文档是否包含可识别的电子发票 XML,并读取 XMP 与 XML 中的基础标识
语法
Delphi
Function TPDFlib.DetectFacturXInvoice: Integer;
返回值
| 0 | 未找到可识别的电子发票 XML |
|---|---|
| 1 | 找到可识别的电子发票 XML |
备注
检测会优先使用 XMP 中的 DocumentFileName,随后尝试 factur-x.xml、xrechnung.xml、zugferd-invoice.xml 与 ZUGFeRD-invoice.xml
调用成功后,可用 GetFacturXInvoiceInfo 读取文件名、版本、conformance level、guideline ID 与 /AFRelationship
示例
// Check whether the loaded PDF carries invoice XML
begin
if PDF.DetectFacturXInvoice = 1 then
InvoiceFileName := PDF.GetFacturXInvoiceInfo(1);
end;
另请参阅
GetFacturXInvoiceInfo、ValidateFacturXInvoice、ExtractFacturXXMLToString