PrintPDFDocument

Methode (Function) · gibt Boolean zurück

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

Beschreibung (Originaltext der englischen SDK-Dokumentation): Prints a PDF document.

Rückgabe: True if printing succeeded; False otherwise (see Last_Error).

Deklaration

Public Function PrintPDFDocument(ByVal FileName As String, ByVal LicenseKey As String, Optional ByRef PrinterName As String = "", Optional ByVal AutoRotate As Boolean = True, Optional ByVal AutoScaling As Boolean = True, Optional ByRef PrintTitle As String = "", Optional ByVal Password As String = "", Optional ByVal StartPage As Integer = -1, Optional ByVal EndPage As Integer = -1) As Boolean

Parameter

NameTypPflichtBeschreibung
FileNameStringerforderlichPath of the PDF file
LicenseKeyStringerforderlichLicence key; if empty the key already set on the object, the global key or a key stored in the registry is used
PrinterNameStringoptional (Standard: "")Name of the printer (passed by reference)
AutoRotateBooleanoptional (Standard: True)True rotates pages automatically (default True)
AutoScalingBooleanoptional (Standard: True)True scales pages automatically (default True)
PrintTitleStringoptional (Standard: "")Title of the print job (passed by reference)
PasswordStringoptional (Standard: "")Password of the PDF, if protected
StartPageIntegeroptional (Standard: -1)First page to print (default -1)
EndPageIntegeroptional (Standard: -1)Last page to print (default -1)

Aufruf (VB.NET)

Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
Dim FileName As String = ""
Dim LicenseKey As String = ""
If Not alo.PrintPDFDocument(FileName, LicenseKey) 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 fileName = "";
string licenseKey = "";
string printerName = "";
bool autoRotate = true;
bool autoScaling = true;
string printTitle = "";
if (!alo.PrintPDFDocument(fileName, licenseKey, ref printerName, autoRotate, autoScaling, ref printTitle))
{
    Console.WriteLine("Fehler: " + alo.Last_Error);
}

Artikel mit PrintPDFDocument

COM-Schnittstelle

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