Leadtools.Pdf Namespace > PDFFile Class : GetPDFFileType Method |
public static PDFFileType GetPDFFileType( string fileName, bool pdfTypesOnly )
'Declaration Public Shared Function GetPDFFileType( _ ByVal fileName As String, _ ByVal pdfTypesOnly As Boolean _ ) As PDFFileType
'Usage Dim fileName As String Dim pdfTypesOnly As Boolean Dim value As PDFFileType value = PDFFile.GetPDFFileType(fileName, pdfTypesOnly)
public: static PDFFileType GetPDFFileType( String^ fileName, bool pdfTypesOnly )
The Load method will internally call GetPDFFileType with pdfTypesOnly set to true before loading the file properties.
When loading PDF files, generally you will call GetPDFFileType first to determine if the file provided by the user is valid PDF. After that, it is recommended you call IsEncrypted to check if the file is encrypted and ask the user for a password before loading the file.
For an example, refer to PDFCompatibilityLevel.