UserPassword
IPDFDocument3 :: General document methods

See Also Example
Collapse All

This property gets or sets the password for view-protection of the PDF document.

Syntax

BSTR UserPassword { get; set; }
Value
String containing the password

Remarks

UserPassword contains a password for the current PDF document. The password is required to view an encrypted PDF file.

Equivalent in new interface: IPDFDocument4::UserPassword.

Example

Protecting a PDF Document with Passwords

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.UserPassword := 'userpassword';
PDF.OwnerPassword := 'superpassword';
PDF.BeginDoc;
{ fill document's content here }
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->UserPassword = "userpassword";
PDF->OwnerPassword = "superpassword";
PDF->BeginDoc();
// fill document's content here
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.UserPassword = "userpassword";
PDF.OwnerPassword = "superpassword";
PDF.BeginDoc();
// fill document's content here
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.UserPassword = "userpassword"
PDF.OwnerPassword = "superpassword"
PDF.BeginDoc
' fill document's content here
PDF.EndDoc

See Also

Reference