PdfDocument.UserPassword Property

Note: This API is now obsolete.

Gets or sets the user password for the document.

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
[ObsoleteAttribute("This property is obsolete and will be removed in the next version of the library. Instead, please assign an instance of PdfStandardEncryptionHandler to SaveOptions.EncryptionHandler property and use the corresponding property in the handler.")]
public string UserPassword { get; set; }
VB
<ObsoleteAttribute("This property is obsolete and will be removed in the next version of the library. Instead, please assign an instance of PdfStandardEncryptionHandler to SaveOptions.EncryptionHandler property and use the corresponding property in the handler.")>
Public Property UserPassword As String
	Get
	Set

Property Value

Type: String
The user password for the document.

Remarks

Opening the document with the correct user password (or opening the document that does not have a user password) allows additional operations to be performed according to the user access Permissions.

Setting OwnerPassword or UserPassword property to a non-empty string causes the document to be saved encrypted.

Setting OwnerPassword and UserPassword property to the empty string causes the document to be saved unencrypted.

If the UserPassword password is set and the OwnerPassword is not then document will be saved with the same value for the user and owner password.

See Also