[]
Gets or sets the password required to open the PDF document, represented as a byte array.
public byte[] UserPasswordBytes { get; set; }
Public Property UserPasswordBytes As Byte()
You can specify the password either as a byte array via UserPasswordBytes or as a string via UserPassword.
According to the PDF specification, string passwords must be converted to bytes using the system code page when the standard security handler (revision 4 or earlier) is used. In some environments, the system code page may not be available, making this conversion impossible.
If the password contains only ASCII characters, this limitation does not apply. However, if it contains non-ASCII Unicode characters, the developer must perform the appropriate string-to-byte conversion and assign the result to UserPasswordBytes.