PDFSigner Class has the method(s) required to sign PDF documents.
Method setLicenseKey
setLicenaseKey method has 2 overloads. It is used for setting License Key for the Library at the application startup. This method should be called only once per application instance, at the early startup of the application.
Skip setLicenseKey call to use the library in DEMO mode.
If LicenseKey is set using setLicenseKey but could not be validated online, it throws exception so that signing does not continue in DEMO mode (with DEMO wartermark!)
Method SignPDF
SignPDF method is used to sign PDF file. Methods takes byte array of pdf file along with signatureSetting object and returns byte array of the signed pdf file.
public static TxnRespWithFile SignPDF( byte[] SourceFile, int PageNo, SignatureSetting signatureSetting, boolean AppendMode, boolean Certified, String AdminPasswordForSourcePDF, String AdminPasswordForOutputPDF, String UserPasswordForOutputPDF, String OutFilePathAndName, DocumentWatermark docWatermarkSetting, int ThreadId) throws Exception
Paramaters:
SourceFile
byte array of source PDF File.
PageNo
PageNo where Digital Signature shall be attached. Pass 0 to use setting from signatureSetting.positionSettings.SignOnPage