←Select platform

Password Property

Gets or sets the password associated with this PDFFile.
public string Password { get; set; } 
Public Property Password As String 
public String getPassword(); 
public void setPassword( 
   java.lang.String string 
property String^ Password { 
   String^ get(); 
   void set (    String^ ); 

Property Value

A System.String that contains the password to use when loading this PDFFile object (if the file is encrypted).


You can also set the password directly when creating a PDFFile object by calling the PDFFile(string fileName, string password) constructor.

Some PDF files are encrypted and require a password before they can be used. Encrypted files must have the Password property set to the correct value before using the other properties and methods of the object. Use IsEncrypted to determine whether the PDF file is encrypted and requires a password.

After setting the filename (and optional password), call the Load method to populate the PDFFile object's DocumentProperties and Pages properties with the correct values. Or use any of the other file feature functions supported by this class.

PDF file passwords can be no more than 64 ASCII characters. LEADTOOLS will automatically truncate and convert the password string to ASCII if necessary. Set the maximum password length by setting the PDFDocument.MaximumPasswordLength constant.


For an example, refer to PDFFile.


Target Platforms

See Also


PDFFile Class

PDFFile Members

Help Version 21.0.2021.3.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly