Table of Contents

Property UserPassword

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

UserPassword

Gets the user password to use while encrypting data.

public string UserPassword { get; }

Property Value

string

The user password to use while encrypting data.

Remarks

User password allows limited access to the document. You can setup permissions for users of the document using UserPermissions property.

If user password is null or empty string and OwnerPassword is not null or empty string, then users of the encrypted document will be able to open it without a password.

If user password is not null or empty string and owner password is null or empty string, then document will be saved with the same value for user and owner passwords.

Password may contain any Unicode codepoints when Algorithm property equals to Aes256Bit.

When Algorithm is Standard40Bit, Standard128Bit or Aes128Bit, we recommend using ASCII characters only in passwords. PDF documents with non-ASCII passwords depend on the current OS code page and might be unreadable on other computers.

Currently, the library throws PdfException while encrypting PDF document with RC4 or AES-128 algorithms if password contains any character outside of Latin-1 character set.

The Encrypt PDF documents in C# and VB.NET article describes how to encrypt PDF documents.