PDF Encryption

PDF encryption enables you to securely protect the content of your PDF file from unwanted viewers and against unwanted actions like printing, selecting text, etc.

Following example shows how to convert any presentation to encrypted PDF file with restricted permissions which requires a password to be decrypted, viewed and, optionally, modified.

Password and owner password should be specified in the appropriate text box.

For more information about PDF encryption in GemBox.Presentation, see PdfSaveOptions.Permissions remarks.

PDF encryption set with GemBox.Presentation
Screenshot of PDF encryption set with GemBox.Presentation
Upload your file (Drag file here)
using GemBox.Presentation;

class Program
    static void Main()
        // If using Professional version, put your serial key below.

        var presentation = PresentationDocument.Load("%InputFileName%");

        string password = "%Password%";
        string ownerPassword = "%OwnerPassword%";

        var options = new PdfSaveOptions()
            DocumentOpenPassword = password,
            PermissionsPassword = ownerPassword,
            Permissions = PdfPermissions.None

        presentation.Save("PDF Encryption.pdf", options);
Imports GemBox.Presentation

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.

        Dim presentation = PresentationDocument.Load("%InputFileName%")

        Dim password As String = "%Password%"
        Dim ownerPassword As String = "%OwnerPassword%"

        Dim options = New PdfSaveOptions() With
            .DocumentOpenPassword = password,
            .PermissionsPassword = ownerPassword,
            .Permissions = PdfPermissions.None

        presentation.Save("PDF Encryption.pdf", options)
    End Sub
End Module

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.

Like it?

Download Buy

If you want to try the GemBox.Presentation yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.