Ascii2PDF
Methode (Function) · gibt Boolean zurück
Ascii2PDF ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.
Beschreibung (Originaltext der englischen SDK-Dokumentation): Creates a PDF from plain text using the Aloaha PDF engine, optionally with a letterhead PDF as background.
Rückgabe: True on success. False on failure; if no valid licence is available, Last_Error is set to "License Problem" (if it was empty).
Hinweis: Requires a valid licence key (LicenseString or the stored .NET licence key).
Deklaration
Public Function Ascii2PDF(ByVal AsciiText As String, Optional ByVal OutputFile As String = "", Optional ByVal Font_name As String = "", Optional ByVal Font_Size As Double = 0, Optional ByVal Line_Distance As Double = 0, Optional ByVal LetterHeadPath As String = "", Optional ByVal LetterheadOnFirstPageOnly As Boolean = False) As Boolean
Parameter
| Name | Typ | Pflicht | Beschreibung |
|---|---|---|---|
AsciiText | String | erforderlich | Text to render |
OutputFile | String | optional (Standard: "") | Path of the PDF file to create |
Font_name | String | optional (Standard: "") | Font name, passed to the PDF engine |
Font_Size | Double | optional (Standard: 0) | Font size, passed to the PDF engine |
Line_Distance | Double | optional (Standard: 0) | Line spacing, passed to the PDF engine |
LetterHeadPath | String | optional (Standard: "") | Optional path of a letterhead PDF |
LetterheadOnFirstPageOnly | Boolean | optional (Standard: False) | True applies the letterhead only to the first page |
Aufruf (VB.NET)
Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
Dim AsciiText As String = ""
If Not alo.Ascii2PDF(AsciiText) 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 asciiText = "";
if (!alo.Ascii2PDF(asciiText))
{
Console.WriteLine("Fehler: " + alo.Last_Error);
}
COM-Schnittstelle
Ascii2PDF ist Mitglied der Schnittstelle Aloaha_ZUGFeRD.iXML (Position 110 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.