MergeXMLIntoTargetPDF
Methode (Function) · gibt Boolean zurück
MergeXMLIntoTargetPDF ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.
Beschreibung (Originaltext der englischen SDK-Dokumentation): Same as MergeXMLIntoPDF, but exceptions are caught and their message is stored in Last_Error. Embeds a ZUGFeRD / Factur-X / XRechnung XML file into a PDF and saves it as PDF/A-3 hybrid invoice. Profile and version are taken from the XML; author, title and keywords are filled from the XML where not given.
Rückgabe: True on success; False otherwise (see Last_Error).
Deklaration
Public Function MergeXMLIntoTargetPDF(ByVal XMLPath As String, ByVal PDFInputPath As String, ByVal PDFOutputPath As String, Optional ByVal DoOverWrite As Boolean = False, Optional ByVal AdditionalFile As String = "", Optional ByVal LicenseKey As String = "", Optional ByVal Author As String = "", Optional ByVal Title As String = "", Optional ByVal Subject As String = "", Optional ByVal Keywords As String = "") As Boolean
Parameter
| Name | Typ | Pflicht | Beschreibung |
|---|---|---|---|
XMLPath | String | erforderlich | Path of the invoice XML file |
PDFInputPath | String | erforderlich | Path of the input PDF file |
PDFOutputPath | String | erforderlich | Path of the output PDF file; if empty the input file is overwritten |
DoOverWrite | Boolean | optional (Standard: False) | True allows overwriting an existing output file (default False) |
AdditionalFile | String | optional (Standard: "") | Optional path of an additional file to embed |
LicenseKey | String | optional (Standard: "") | Licence key; if empty the key already set on the object, the global key or a key stored in the registry is used |
Author | String | optional (Standard: "") | PDF author; if empty the seller name from the XML is used |
Title | String | optional (Standard: "") | PDF title; if empty "Invoice: " followed by the invoice number from the XML is used |
Subject | String | optional (Standard: "") | PDF subject; if empty the PaymentReference property of this object (not of the merged XML) is used; double quotes are removed |
Keywords | String | optional (Standard: "") | PDF keywords; if empty "XRechnung, XInvoice, ZUGFeRD" plus the buyer name is used |
Aufruf (VB.NET)
Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
Dim XMLPath As String = ""
Dim PDFInputPath As String = ""
Dim PDFOutputPath As String = ""
If Not alo.MergeXMLIntoTargetPDF(XMLPath, PDFInputPath, PDFOutputPath) Then
Console.WriteLine("Fehler: " & alo.Last_Error)
End If
Aufruf (C#)
var zfStandard = Aloaha_ZUGFeRD.iXML.ZUGFeRDVersion.xInvoice; // Optional ByRef im Konstruktor: in C# mit ref übergeben
var alo = new Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, false, "IHR-LIZENZSCHLUESSEL", ref zfStandard);
string xmlPath = "";
string pdfInputPath = "";
string pdfOutputPath = "";
if (!alo.MergeXMLIntoTargetPDF(xmlPath, pdfInputPath, pdfOutputPath))
{
Console.WriteLine("Fehler: " + alo.Last_Error);
}
COM-Schnittstelle
MergeXMLIntoTargetPDF ist Mitglied der Schnittstelle Aloaha_ZUGFeRD.iXML (Position 160 von 343) und damit auch aus VB6, VBA/Access und anderen COM-Clients über CreateObject("Aloaha_ZUGFeRD.XML") aufrufbar. Neue Mitglieder werden immer am Ende von iXML angefügt, damit bestehende COM-Clients unverändert weiterlaufen; nach einem Update die Typbibliothek neu registrieren.