C# Code Example
//reset PDF Signature structure - optional
PDFSign.ResetPDFSignatureStructure();
//get the signing certificate from Microsoft Store
PDFSign.SetSigningCertificate(false);
//OR the certificate can be get from a PFX file
PDFSign.SetSigningCertificate("c:\\cert.pfx", "PFX_P@ssw0rD");
//signature position: bottom right
PDFSign.SignaturePosition = SignatureLocation.BottomRight;
//signed by prefix
PDFSign.SignedBy = "Signed by text:";
//date format
PDFSign.DateFormat = "yyyy-MM-dd";
//timestamp the PDF file
PDFSign.TSAServerURL = "http://www.ca-soft.com/request.aspx";
//certify the PDF document
PDFSign.CertifyDocument = CertifyMethod.NoChangesAllowed;
//digitally sign PDF file
PDFSign.SignPDFFile("c:\\source.pdf", "c:\\source[signed].pdf");
Console.WriteLine("Done!");
Visual Basic.NET Code Example
'reset PDF Signature structure - optional
PDFSign.ResetPDFSignatureStructure()
'get the signing certificate from Microsoft Store
PDFSign.SetSigningCertificate(False)
'OR the certificate can be get from a PFX file
PDFSign.SetSigningCertificate("c:\cert.pfx", "PFX_P@ssw0rD")
'signature position: bottom right
PDFSign.SignaturePosition = SignatureLocation.BottomRight
'signed by prefix
PDFSign.SignedBy = "Signed by text:"
'date format
PDFSign.DateFormat = "yyyy-MM-dd"
'timestamp the PDF file
PDFSign.TSAServerURL = "http://www.ca-soft.com/request.aspx"
'certify the PDF document
PDFSign.CertifyDocument = CertifyMethod.NoChangesAllowed
'digitally sign PDF file
PDFSign.SignPDFFile("c:\source.pdf", "c:\source[signed].pdf")
Console.WriteLine("Done!")
Visual C++ Code Example
//reset PDF Signature structure - optional
PDFSign::ResetPDFSignatureStructure();
//get the signing certificate from Microsoft Store
PDFSign::SetSigningCertificate(false);
//OR the certificate can be get from a PFX file
PDFSign::SetSigningCertificate("c:\cert.pfx", "PFX_P@ssw0rD");
//signature position: bottom right
PDFSign::SignaturePosition = SignatureLocation::BottomRight;
//signed by prefix
PDFSign::SignedBy = "Signed by text:";
//date format
PDFSign::DateFormat = "yyyy-MM-dd";
//timestamp the PDF file
PDFSign::TSAServerURL = "http://www.ca-soft.com/request.aspx";
//certify the PDF document
PDFSign::CertifyDocument = CertifyMethod.NoChangesAllowed;
//digitally sign PDF file
PDFSign::SignPDFFile("c:\source.pdf", "c:\source.pdf");
Console::WriteLine("Done!");