MergeXMLStreamIntoPDFStream

Methode (Function) · gibt Boolean zurück

MergeXMLStreamIntoPDFStream ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.

Beschreibung (Originaltext der englischen SDK-Dokumentation): Embeds a ZUGFeRD / Factur-X / XRechnung XML into a PDF, both supplied as streams, and returns the resulting PDF/A-3 as stream. Uses temporary files (deleted afterwards) and MergeXMLIntoPDF.

Rückgabe: True on success; False otherwise (see Last_Error).

Deklaration

Public Function MergeXMLStreamIntoPDFStream(ByVal XMLData As System.IO.Stream, ByVal PDFInputStream As System.IO.Stream, ByRef PDFOutputStream As System.IO.Stream, 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

NameTypPflichtBeschreibung
XMLDataSystem.IO.StreamerforderlichStream containing the invoice XML
PDFInputStreamSystem.IO.StreamerforderlichStream containing the input PDF
PDFOutputStreamSystem.IO.Streamerforderlich(output) MemoryStream with the resulting PDF; only set on success
AdditionalFileStringoptional (Standard: "")Optional path of an additional file to embed
LicenseKeyStringoptional (Standard: "")Licence key; if empty the key already set on the object, the global key or a key stored in the registry is used
AuthorStringoptional (Standard: "")PDF author; if empty the seller name from the XML is used
TitleStringoptional (Standard: "")PDF title; if empty "Invoice: " followed by the invoice number from the XML is used
SubjectStringoptional (Standard: "")PDF subject; if empty the PaymentReference property of this object (not of the merged XML) is used; double quotes are removed
KeywordsStringoptional (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 XMLData As System.IO.Stream = Nothing
Dim PDFInputStream As System.IO.Stream = Nothing
Dim PDFOutputStream As System.IO.Stream = Nothing
If Not alo.MergeXMLStreamIntoPDFStream(XMLData, PDFInputStream, PDFOutputStream) 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);
System.IO.Stream xmlData = default;
System.IO.Stream pdfInputStream = default;
System.IO.Stream pdfOutputStream = default;
if (!alo.MergeXMLStreamIntoPDFStream(xmlData, pdfInputStream, ref pdfOutputStream))
{
    Console.WriteLine("Fehler: " + alo.Last_Error);
}

COM-Schnittstelle

MergeXMLStreamIntoPDFStream ist Mitglied der Schnittstelle Aloaha_ZUGFeRD.iXML (Position 108 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.

Quelle: XML-Dokumentationskommentare des Aloaha ZUGFeRD SDK (xml.vb). Gleiche Signatur in VB6/VBA über COM. In C# werden ByRef-Parameter mit ref übergeben, VB-Eigenschaften mit Parametern heißen get_…/set_…, optionale Parameter können entfallen.