PDF Digital Signature

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

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

Certificate file: GemBoxSampleExplorer.pfx.

Signature file: GemBoxSignature.png.

Screenshot
PDF Digital Signature Screenshot

See the full code below, use Run Example to execute.

Upload your file(Drag files here)

Download an input file

using System.IO;
using GemBox.Presentation;

class Sample
{
    [STAThread]
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        PresentationDocument presentation = PresentationDocument.Load("Reading.pptx");

        string pathToResources = "Resources";

        var slide = presentation.Slides[0];

        Picture signature = null;
        using (var stream = File.OpenRead(
            Path.Combine(pathToResources, "GemBoxSignature.png")))
            signature = slide.Content.AddPicture(
                PictureContentType.Png, stream, 25, 15, 4, 1, LengthUnit.Centimeter);

        var options = new PdfSaveOptions()
        {
            DigitalSignature =
            {
                CertificatePath = Path.Combine(
                    pathToResources, "GemBoxSampleExplorer.pfx"),
                CertificatePassword = "GemBoxPassword",
                Signature = signature
            }
        };

        presentation.Save("PDF Digital Signature.pdf", options);
    }
}
Imports System.IO
Imports GemBox.Presentation

Module Samples

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim presentation As PresentationDocument = PresentationDocument.Load("Reading.pptx")

        Dim pathToResources As String = "Resources"

        Dim slide As Slide = presentation.Slides(0)

        Dim signature As Picture = Nothing
        Using stream As Stream = File.OpenRead(
            Path.Combine(pathToResources, "GemBoxSignature.png"))
            signature = slide.Content.AddPicture(
                PictureContentType.Png, stream, 25, 15, 4, 1, LengthUnit.Centimeter)
        End Using

        Dim options = New PdfSaveOptions()
        Dim digitalSignature = options.DigitalSignature

        digitalSignature.CertificatePath = Path.Combine(
            pathToResources, "GemBoxSampleExplorer.pfx")
        digitalSignature.CertificatePassword = "GemBoxPassword"
        digitalSignature.Signature = signature

        presentation.Save("PDF Digital Signature.pdf", options)

    End Sub

End Module