PDFAMetaProperties

Methode (Function) · gibt Boolean zurück

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

Beschreibung (Originaltext der englischen SDK-Dokumentation): Reads the ZUGFeRD / Factur-X XMP extension properties (DocumentFileName, ConformanceLevel, DocumentType, Version) from the metadata of a PDF.

Rückgabe: True if version, file name and conformance level were found, otherwise False.

Deklaration

Public Function PDFAMetaProperties(ByVal InputPDF As String, ByRef ZUGFeRD_Version As String, ByRef ZUGFeRD_Level As String, ByRef ZUGFeRD_FileName As String, Optional ByVal Licensekey As String = "", Optional ByRef ZUGFeRD_DocumentType As String = "", Optional ByRef XMLMetaDataSTR As String = "") As Boolean

Parameter

NameTypPflichtBeschreibung
InputPDFStringerforderlichPath of the PDF file
ZUGFeRD_VersionStringerforderlich(output) Version from the XMP metadata
ZUGFeRD_LevelStringerforderlich(output) Conformance level, e.g. EN 16931, EXTENDED
ZUGFeRD_FileNameStringerforderlich(output) Name of the embedded XML file (only if it contains .xml)
LicensekeyStringoptional (Standard: "")Optional licence key
ZUGFeRD_DocumentTypeStringoptional (Standard: "")(output) Document type, e.g. INVOICE
XMLMetaDataSTRStringoptional (Standard: "")Reserved; not filled

Aufruf (VB.NET)

Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
Dim InputPDF As String = ""
Dim ZUGFeRD_Version As String = ""
Dim ZUGFeRD_Level As String = ""
Dim ZUGFeRD_FileName As String = ""
If Not alo.PDFAMetaProperties(InputPDF, ZUGFeRD_Version, ZUGFeRD_Level, ZUGFeRD_FileName) 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 inputPDF = "";
string zugferd_Version = "";
string zugferd_Level = "";
string zugferd_FileName = "";
string licensekey = "";
string zugferd_DocumentType = "";
string xmlMetaDataSTR = "";
if (!alo.PDFAMetaProperties(inputPDF, ref zugferd_Version, ref zugferd_Level, ref zugferd_FileName, licensekey, ref zugferd_DocumentType, ref xmlMetaDataSTR))
{
    Console.WriteLine("Fehler: " + alo.Last_Error);
}

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.