Leadtools.Pdf Namespace > PDFFile Class : IsEncrypted Method |
function Leadtools.Pdf.PDFFile.IsEncrypted( fileName )
This method checks if the PDF file has been encrypted and protected with a password. If this is the case, then you must create a PDFFile object (or set the Password property) to the correct file before you can use the other methods of this object.
To load PDF files, you generally perfrom this:
Call GetPDFFileType with pdfTypesOnly set to true and check if the return value is not PDFFileType.Unknown meaning a valid PDF file of any version.
Call IsEncrypted to check if the file is encrypted (password protected), if so, instruct the user for the password to use with this PDF file.
Finally construct a PDFFile object with the file name and password (if any) and call its methods.
For an example, refer to PDFFile.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2