Search Results for

    Show / Hide Table of Contents

    Class PdfSecuritySettings

    Enterprise-grade PDF security: pdf.SecuritySettings.MakePdfDocumentReadOnly("owner123") Control passwords, 128-bit encryption, permissions for print/copy/edit. Essential for legal, financial, and government documents. Used via PdfDocument.SecuritySettings property.

    Inheritance
    System.Object
    PdfClientAccessor
    PdfSecuritySettings
    Namespace: IronPdf.Security
    Assembly: IronPdf.dll
    Syntax
    public class PdfSecuritySettings : PdfClientAccessor
    Remarks
    IronPDF provides bank-grade security features: - 128-bit AES encryption (industry standard) - User passwords (open/view access) - Owner passwords (permission control) - Granular permissions (print, copy, edit, annotate) - Compatible with Adobe Acrobat security model
    using IronPdf;
    

    // Basic password protection var pdf = PdfDocument.FromFile("sensitive.pdf"); pdf.SecuritySettings.UserPassword = "view123"; // Required to open pdf.SecuritySettings.OwnerPassword = "admin456"; // Required to change settings pdf.SaveAs("protected.pdf");

    // Make completely read-only (government/legal use) var contract = PdfDocument.FromFile("contract.pdf"); contract.SecuritySettings.MakePdfDocumentReadOnly("owner-secret"); // Now: No copying, No printing, No editing, No annotations contract.SaveAs("final-contract.pdf");

    // Custom permissions (corporate policy) var report = PdfDocument.FromFile("quarterly-report.pdf"); report.SecuritySettings.OwnerPassword = "exec2024"; report.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights; report.SecuritySettings.AllowUserCopyPasteContent = false; // Prevent data leaks report.SecuritySettings.AllowUserEdits = PdfEditSecurity.NoEdit; report.SecuritySettings.AllowUserAnnotations = true; // Allow comments report.SaveAs("q4-report-secure.pdf");

    Properties

    AllowUserAnnotations

    Gets or sets the permissions for users to annotate the PDF document with comments.

    If AllowUserAnnotations is set false, the OwnerPassword must be set for the security measure to take effect.

    Declaration
    public bool AllowUserAnnotations { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if users may annotate the PDF document, otherwise false.

    AllowUserCopyPasteContent

    Gets or sets the permissions for users to extract or 'copy & paste' content (text and images) from the PDF document.

    If AllowUserCopyPasteContent is set false, the OwnerPassword must also be set for the security measure to take effect.

    Declaration
    public bool AllowUserCopyPasteContent { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if users may 'copy and paste' content out of the PDF otherwise, false.

    AllowUserCopyPasteContentForAccessibility

    Gets or sets the permissions for users to extract or 'copy & paste' content (text and images) from the PDF document for accessibility.

    Declaration
    public bool AllowUserCopyPasteContentForAccessibility { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if users may 'copy and paste' content out of the PDF otherwise, false.

    AllowUserEdits

    Gets or sets the permissions for users edit the PDF document. The features to edit the document depends entirely on the PDF client software used by the end user.

    If editing rights are restricted, then the OwnerPassword must be set for the security measure to take effect.

    Declaration
    public PdfEditSecurity AllowUserEdits { get; set; }
    Property Value
    Type Description
    PdfEditSecurity

    The PdfEditSecurity value for user edit security.

    AllowUserFormData

    Gets or sets the permissions for users to fill-in (enter data into) forms in the PDF document.

    If AllowUserFormData is set false, the OwnerPassword must be set for the security measure to take effect.

    Note. If you want to make the form readonly in Adobe Acrobat Reader please call MakePdfDocumentReadOnly(String) method or set AllowUserEdits to NoEdit and set OwnerPassword.

    Declaration
    public bool AllowUserFormData { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if users may annotate the PDF document, otherwise false. Setting AllowUserFormData true will also enable annotations.

    AllowUserPrinting

    Gets or sets the permissions for users to print the PDF document.

    If print rights are restricted, then the OwnerPassword must be set for the security measure to take effect.

    Declaration
    public PdfPrintSecurity AllowUserPrinting { get; set; }
    Property Value
    Type Description
    PdfPrintSecurity

    The PdfPrintSecurity value for user printing.

    OwnerPassword

    Sets the owner password and enables 128Bit encryption of PDF content. An owner password is one used to enable and disable all other security settings.

    OwnerPassword must be set to a non empty string value for AllowUserCopyPasteContent, AllowUserAnnotations, AllowUserFormData,s AllowUserPrinting and AllowUserEdits to be restricted.

    Declaration
    public string OwnerPassword { get; set; }
    Property Value
    Type Description
    System.String

    UserPassword

    Sets the user password and enables 128Bit encryption of PDF content .

    A user password is a password that each user must enter to open or print the PDF document.

    Declaration
    public string UserPassword { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    MakePdfDocumentReadOnly(String)

    Declaration
    public void MakePdfDocumentReadOnly(string OwnerPassword)
    Parameters
    Type Name Description
    System.String OwnerPassword

    RemovePasswordsAndEncryption(Boolean)

    Removes all user and owner password security for a PDF document. Also disables content encryption.

    Content is encrypted at 128 bit. Copy and paste of content is disallowed. Annotations and form editing are disabled.

    Remove all digital signatures from the PDF document. (Recommended, since they will become invalidated anyway.)
    Declaration
    public void RemovePasswordsAndEncryption(bool RemoveSignatures = true)
    Parameters
    Type Name Description
    System.Boolean RemoveSignatures
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronPDF_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronPDF