CreateInvoiceRulePackageA
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
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to CreateInvoiceRulePackage and string arguments are interpreted using the current SetAnsiMode code page
Turns a directory holding a schema, a compiled Schematron stylesheet and their supporting files into a rule package by writing a rulepackage.xml manifest with the SHA-256 of every file
Syntax
Delphi
Function DLCreateInvoiceRulePackageA(InstanceID: Integer; Directory, Standard, RulesVersion, RulesProfile, Syntax, SchemaFile, SchematronStylesheetFile: PAnsiChar): PAnsiChar;
DLL
const char* DLCreateInvoiceRulePackageA(int InstanceID, const char* Directory, const char* Standard, const char* RulesVersion, const char* RulesProfile, const char* Syntax, const char* SchemaFile, const char* SchematronStylesheetFile);
Parameters
| Parameter | Description |
|---|---|
| Directory | The package directory; every file below it except an existing manifest is listed |
| Standard, RulesVersion | The standard and the rule release, both required |
| RulesProfile, Syntax | Optional profile and syntax names, such as EN16931 and CII |
| SchemaFile, SchematronStylesheetFile | The schema and the compiled Schematron stylesheet relative to Directory; at least one is required |
Return values
The package information as JSON, as returned by GetInvoiceRulePackageInfo; sha256 is the digest to pin in later validations
Remarks
Run it once when you approve a rule release, keep the returned digest with your configuration and pass it to ValidateInvoiceBusinessRulesWithPackage; any later change to a package file or the manifest then stops validation
Example
Writeln(PDF.CreateInvoiceRulePackage('C:\Rules\EN16931-CII-1.3.16', 'EN16931', '1.3.16',
'EN16931', 'CII', 'schema/FACTUR-X_EN16931.xsd', 'schematron/EN16931-CII-validation.xslt'));
See also
GetInvoiceRulePackageInfo, ValidateInvoiceBusinessRulesWithPackage