PDF Digital Signature

A PDF digital signature enables you to authenticate a PDF file to establish that the sender of the file is who they say they are and the content of the PDF file has not been tampered with.

The following example shows how to create a digitally signed PDF file.

To view and verify the signature in Acrobat Reader, go to the menu button 'View', then expand 'Show/Hide' and 'Navigation Panes', and click 'Signatures'.

Certificate file: GemBoxSampleExplorer.pfx.

Screenshot

PDF Digital Signature Screenshot

See the full code below, use RUN EXAMPLE to execute.

Upload your file (Drag files here)

1using GemBox.Spreadsheet;
2using System.IO;
3
4class Sample
5{
6    [STAThread]
7    static void Main(string[] args)
8    {
9        // If using Professional version, put your serial key below.
10        SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");
11
12        ExcelFile ef = ExcelFile.Load("SimpleTemplate.xlsx");
13
14        string pathToResources = "Resources";
15
16        var options = new PdfSaveOptions()
17        {
18            DigitalSignature =
19            {
20                CertificatePath = Path.Combine(pathToResources, "GemBoxSampleExplorer.pfx"),
21                CertificatePassword = "GemBoxPassword"
22            }
23        };
24
25        ef.Save("PDF Digital Signature.pdf", options);
26    }
27}
1Imports GemBox.Spreadsheet
2Imports System.IO
3
4Module Samples
5
6    Sub Main()
7
8        ' If using Professional version, put your serial key below.
9        SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY")
10
11        Dim ef As ExcelFile = ExcelFile.Load("SimpleTemplate.xlsx")
12
13        Dim pathToResources As String = "Resources"
14
15        Dim options = New PdfSaveOptions()
16        Dim digitalSignature = options.DigitalSignature
17
18        digitalSignature.CertificatePath = Path.Combine(pathToResources, "GemBoxSampleExplorer.pfx")
19        digitalSignature.CertificatePassword = "GemBoxPassword"
20
21        ef.Save("PDF Digital Signature.pdf", options)
22
23    End Sub
24
25End Module

Check next sample or find out more about GemBox.Spreadsheet and GemBox Software.