SignFileA

Security and Signatures

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to SignFile and string arguments are interpreted using the current SetAnsiMode code page

Applies a digital signature to a PDF document on disk

The signing identity must be in PKCS#12 format containing a certificate and private key

Syntax

Delphi

Function DLSignFileA(InstanceID: Integer; InputFileName, OpenPassword, SignatureFieldName, OutputFileName, PFXFileName, PFXPassword, Reason, Location, ContactInfo: PAnsiChar): Integer;

DLL

int DLSignFileA(int InstanceID, const char* InputFileName, const char* OpenPassword, const char* SignatureFieldName, const char* OutputFileName, const char* PFXFileName, const char* PFXPassword, const char* Reason, const char* Location, const char* ContactInfo);

Parameters

InputFileNameThe path and file name of the input PDF to sign
OpenPasswordThe optional password to open the input PDF if it is encrypted
SignatureFieldNameThe name of the signature field to sign. If a field with this name does not exist it will be created. This field cannot be blank
OutputFileNameThe path and file name of the signed PDF that should be created. This should be a different file to InputFileName. If in place signing is required (overwriting the original file) then this parameter should be left blank
PFXFileNameThe path and name of the PKCS#12 certificate/private key file (.pfx file)
PFXPasswordThe password to open the PFX file
ReasonAn optional string indicating the reason for signing
LocationAn optional string indicating the location that the signing was done
ContactInfoAn optional string indicating the contact information of the signer

Return values

1The file was signed successfully
2Input PDF not found
3Input PDF cannot be read
4Input PDF password incorrect
5Certificate file not found
6Certificate file is invalid
7Incorrect certificate password
8Unknown certificate format
9No private key found in certificate file
10Could not write output file
11Could not apply signature
12The signature field name was blank