GetInvoiceRulePackageInfo

Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0, an empty string or False and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

E-invoicing

Description

Reads a rule package manifest, checks every listed file against its SHA-256 and returns the result, so an application can show or record which rule release it validates with

Syntax

Delphi

Function TPDFlib.GetInvoiceRulePackageInfo(Const PackageFile, PackageSHA256: WideString): WideString; Virtual;

ActiveX

Function PDFlib::GetInvoiceRulePackageInfo(PackageFile As String, PackageSHA256 As String) As String

DLL

const wchar_t* DLGetInvoiceRulePackageInfo(int InstanceID, const wchar_t* PackageFile, const wchar_t* PackageSHA256);
const char* DLGetInvoiceRulePackageInfoA(int InstanceID, const char* PackageFile, const char* PackageSHA256);

Parameters

ParameterDescription
PackageFileThe rule package directory or its rulepackage.xml manifest
PackageSHA256The expected SHA-256 of the manifest, or empty

Return values

A JSON object with manifest, sha256 (the manifest digest to pin), pinned, verified, standard, version, profile, syntax, schema, schematron, files and, when verification failed, error with code and message

Remarks

The manifest format is described for ValidateInvoiceBusinessRulesWithPackage. Error codes are RulePackage.Missing, RulePackage.Manifest, RulePackage.Path, RulePackage.Integrity and RulePackage.Digest

Example

Writeln(PDF.GetInvoiceRulePackageInfo('C:\Rules\EN16931-CII-1.3.16', ''));

See also

CreateInvoiceRulePackage, ValidateInvoiceBusinessRulesWithPackage