PDFsharp-net6

PdfSecuritySettings

Namespace: PdfSharp.Pdf.Security

Encapsulates access to the security settings of a PDF document.

public sealed class PdfSecuritySettings

Inheritance ObjectPdfSecuritySettings

Properties

HasOwnerPermissions

Indicates whether the granted access to the document is ‘owner permission’. Returns true if the document is unprotected or was opened with the owner password. Returns false if the document was opened with the user password.

public bool HasOwnerPermissions { internal get; set; }

Property Value

Boolean

UserPassword

Sets the user password of the document. Setting a password automatically sets the PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current value is PdfDocumentSecurityLevel.None.

public string UserPassword { set; }

Property Value

String

OwnerPassword

Sets the owner password of the document. Setting a password automatically sets the PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current value is PdfDocumentSecurityLevel.None.

public string OwnerPassword { set; }

Property Value

String

PermitPrint

Permits printing the document. Should be used in conjunction with PermitFullQualityPrint.

public bool PermitPrint { get; set; }

Property Value

Boolean

PermitModifyDocument

Permits modifying the document.

public bool PermitModifyDocument { get; set; }

Property Value

Boolean

PermitExtractContent

Permits content copying or extraction.

public bool PermitExtractContent { get; set; }

Property Value

Boolean

PermitAnnotations

Permits commenting the document.

public bool PermitAnnotations { get; set; }

Property Value

Boolean

PermitFormsFill

Permits filling of form fields.

public bool PermitFormsFill { get; set; }

Property Value

Boolean

PermitAssembleDocument

Permits to insert, rotate, or delete pages and create bookmarks or thumbnail images even if PermitModifyDocument is not set.

public bool PermitAssembleDocument { get; set; }

Property Value

Boolean

PermitFullQualityPrint

Permits to print in high quality. insert, rotate, or delete pages and create bookmarks or thumbnail images even if PermitModifyDocument is not set.

public bool PermitFullQualityPrint { get; set; }

Property Value

Boolean

Methods

CanSave(String&)

Determines whether the document can be saved.

internal bool CanSave(String& message)

Parameters

message String&

Returns

Boolean

HasPermissionsOfRevision3OrHigherSetTo0(UInt32)

Returns true if there are permissions set to zero, that were introduced with security handler revision 3.

public static bool HasPermissionsOfRevision3OrHigherSetTo0(uint permission)

Parameters

permission UInt32
The permission uint value containing the PdfUserAccessPermission flags.

Returns

Boolean