SignPDFRemote
Methode (Function) · gibt Boolean zurück
SignPDFRemote ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.
Beschreibung (Originaltext der englischen SDK-Dokumentation): Signs a PDF remotely with the CodeB Remote Signature Service (CSC v2, endpoint signatures/signDocBasic): the PDF is sent via HTTPS, the service returns it with a PAdES signature (incremental update, existing content and attachments such as the ZUGFeRD XML stay unchanged).
Rückgabe: True if the signed PDF was written; False otherwise (reason in Last_Error, e.g. "HTTP 401 invalid_credentials").
Hinweis: Requires a valid licence and internet access to the CodeB tenant. Signature level: eIDAS advanced (AdES), not qualified.
Deklaration
Public Function SignPDFRemote(ByVal InputPDFPath As String, ByVal OutputPDFPath As String, ByVal ServerURL As String, ByVal UserName As String, ByVal Password As String, Optional ByVal Level As String = "B-LTA", Optional ByVal Reason As String = "", Optional ByVal Location As String = "", Optional ByVal ContactInfo As String = "", Optional ByVal DoOverWrite As Boolean = True, Optional ByVal LicenseKey As String = "", Optional ByRef EffectiveLevel As String = "", Optional ByVal TimeoutSeconds As Integer = 120) As Boolean
Parameter
| Name | Typ | Pflicht | Beschreibung |
|---|---|---|---|
InputPDFPath | String | erforderlich | PDF to sign (max. 10 MiB, not encrypted). For ZUGFeRD: embed the XML first, sign last. |
OutputPDFPath | String | erforderlich | Signed PDF. Empty: the input file is replaced (DoOverWrite must be True). |
ServerURL | String | erforderlich | Base URL of the CodeB tenant, e.g. https://your-codeb-server (https only). https://phone.codeb.io is CodeB's public service (live since October 2026); your own CodeB server works the same way. A full .../csc.ashx?action=... or .../csc/v2 URL is accepted as well. |
UserName | String | erforderlich | CodeB user name (HTTP Basic). The tenant must allow it (Oidc:EnablePasswordGrant=true). |
Password | String | erforderlich | CodeB password. Never written to Last_Error or logs. |
Level | String | optional (Standard: "B-LTA") | PAdES level: B-B, B-T, B-LT or B-LTA (default). The service may lower it (see EffectiveLevel). |
Reason | String | optional (Standard: "") | Optional /Reason of the signature. |
Location | String | optional (Standard: "") | Optional /Location of the signature. |
ContactInfo | String | optional (Standard: "") | Optional /ContactInfo of the signature. |
DoOverWrite | Boolean | optional (Standard: True) | True (default) replaces an existing output file. |
LicenseKey | String | optional (Standard: "") | Licence key; empty uses the licence already set. |
EffectiveLevel | String | optional (Standard: "") | Returns the level the service actually produced (e.g. AdES-B-T if the requested level could not be produced). |
TimeoutSeconds | Integer | optional (Standard: 120) | HTTP timeout in seconds (default 120). |
Aufruf (VB.NET)
Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
Dim InputPDFPath As String = ""
Dim OutputPDFPath As String = ""
Dim ServerURL As String = ""
Dim UserName As String = ""
Dim Password As String = ""
If Not alo.SignPDFRemote(InputPDFPath, OutputPDFPath, ServerURL, UserName, Password) 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 inputPDFPath = "";
string outputPDFPath = "";
string serverURL = "";
string userName = "";
string password = "";
string level = "B-LTA";
string reason = "";
string location = "";
string contactInfo = "";
bool doOverWrite = true;
string licenseKey = "";
string effectiveLevel = "";
if (!alo.SignPDFRemote(inputPDFPath, outputPDFPath, serverURL, userName, password, level, reason, location, contactInfo, doOverWrite, licenseKey, ref effectiveLevel))
{
Console.WriteLine("Fehler: " + alo.Last_Error);
}
COM-Schnittstelle
SignPDFRemote ist Mitglied der Schnittstelle Aloaha_ZUGFeRD.iXML (Position 326 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.