AddFacturXAssociatedFileFromString
Documenteigenschappen
Beschrijving
Schrijft e-factuur-XML als PDF/A-3-geassocieerd bestand en genereert de vereiste XMP e-factuur-metadata voor de profielen Factur-X, ZUGFeRD en XRechnung
Syntaxis
Delphi
Function TPDFlib.AddFacturXAssociatedFileFromString(Const XMLBytes: AnsiString; Const ConformanceLevel, FileName, Description, Relationship, Version, CountryCode: WideString): Integer;
Syntaxis
| XMLBytes | De rauwe UTF-8 XML-bytes die moeten worden ingebed |
|---|---|
| ConformanceLevel | Het factuurprofielniveau, zoals MINIMUM, BASIC WL, BASIC, EN16931, EXTENDED, XRECHNUNG, EXTENDED-CTC-FR of EXTENDED-B2B-FR |
| FileName | De ingesloten XML-bestandsnaam, meestal factur-x.xml, xrechnung.xml, zugferd-invoice.xml of ZUGFeRD-invoice.xml; een lege waarde valt terug op factur-x.xml |
| Description | De optionele /Desc-tekst die naar de filespecificatie wordt geschreven |
| Relationship | De /AFRelationship-waarde; een lege waarde valt terug op Alternative |
| Version | De factuurprofielversie; een lege waarde valt terug op 1.0 |
| CountryCode | An optional country profile code, such as an empty string, DE, or FR |
Retourwaarden
| 0 | Het document staat niet in de PDF/A-3-modus, de combinatie van XML en profiel is ongeldig of factuur-XML is al toegevoegd |
|---|---|
| Non-zero | De objecthandle van de nieuw aangemaakte filespecificatie |
Opmerkingen
De methode valideert de bestandsnaam, het conformit niveau, de versie, het landprofiel en /AFRelationship voordat de bijlage wordt weggeschreven
COMFORT wordt alleen geaccepteerd met ZUGFeRD-invoice.xml en versie 1.0; zugferd-invoice.xml kiest het ZUGFeRD 2.0-profiel en xrechnung.xml kiest het XRECHNUNG-profiel
De methode schrijft de XMP-velden DocumentFileName, DocumentType, Version en ConformanceLevel en controleert of de XML-richtlijn-ID overeenkomt met het geselecteerde profiel. De normale zichtbare inhoud van de factuurpagina wordt nog steeds door de aanroeper gemaakt voordat deze opslaat
Voorbeeld
// Add EN 16931 invoice XML to a PDF/A-3b document
var
FileID: Integer;
begin
PDF.SetPDFAMode(5);
PDF.NewDocument;
FileID := PDF.AddFacturXAssociatedFileFromString(
InvoiceXML,
'EN16931',
'factur-x.xml',
'Factur-X invoice XML',
'Alternative',
'1.0',
'');
if FileID = 0 then Exit;
PDF.SaveToFile('factur-x.pdf');
end;
Zie ook
AddPDFA3AssociatedFileFromString, DetectFacturXInvoice, ValidateFacturXInvoice, ExtractFacturXXMLToString