LEADTOOLS PDF (Leadtools.Pdf assembly)
LEAD Technologies, Inc

GetPDFFileType Method






The name of the PDF or Postscript file.
true to only recognize PDF files, Postscript files will not be recognized and PDFFileType.Unknown will be returned when fileName is a PS or EPS file. false to recognize PDF and PS files.
Get the type of a PDF or Postscript file.
Syntax
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
)
 function Leadtools.Pdf.PDFFile.GetPDFFileType( 
   fileName ,
   pdfTypesOnly 
)
public:
static PDFFileType GetPDFFileType( 
   String^ fileName,
   bool pdfTypesOnly
) 

Parameters

fileName
The name of the PDF or Postscript file.
pdfTypesOnly
true to only recognize PDF files, Postscript files will not be recognized and PDFFileType.Unknown will be returned when fileName is a PS or EPS file. false to recognize PDF and PS files.

Return Value

An PDFFileType enumeration member that determines the type of the file. If the file is not PDF (or Postscript depending on pdfTypesOnly), then PDFFileType.Unknown is returned.
Remarks

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.

Example

For an example, refer to PDFCompatibilityLevel.

Requirements

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

See Also

Reference

PDFFile Class
PDFFile Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.