←Select platform

PDFFileType Enumeration

Summary
Specifies PDF and PS (Postscript) file type and version.
Syntax
C#
C++/CLI
Java
Python
[SerializableAttribute()] 
public enum PDFFileType  
public enum PDFFileType 
[SerializableAttribute()] 
public enum class PDFFileType  
class PDFFileType(Enum): 
   Unknown = 0 
   PDF10 = 1 
   PDF11 = 2 
   PDF12 = 3 
   PDF13 = 4 
   PDF14 = 5 
   PDF15 = 6 
   PDF16 = 7 
   PDF17 = 8 
   Postscript = 9 
   EncapsulatedPostscript = 10 
Members
ValueMemberDescription
0Unknown Not a valid PDF or PS (Postscript) file
1PDF10 PDF Version 1.0
2PDF11 PDF Version 1.1
3PDF12 PDF Version 1.2
4PDF13 PDF Version 1.3
5PDF14 PDF Version 1.4
6PDF15 PDF Version 1.5
7PDF16 PDF Version 1.6
8PDF17 PDF Version 1.7
9Postscript Postscript file (PS)
10EncapsulatedPostscript Encapsulated Postscript file (EPS)
Remarks

The PDFFileType enumeration is used as the return value from PDFFile.GetPDFFileType method and as the type of the PDFDocument.FileType property. It determines the type and version of the PDF or PS file.

Note: The PDFDocument class can be associate with a PDF only and does not support Postscript files. As a result, the value of PDFDocument.FileType will only be one of the PDF version values.

Example
C#
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
 
 
public void PDFCompatibilityLevelExample() 
{ 
   string sourceFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
   string destFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD_14.pdf"); 
 
   // Check the version of the source file 
   PDFFileType fileType = PDFFile.GetPDFFileType(sourceFileName, true); 
   if (fileType == PDFFileType.Unknown) 
   { 
      Console.WriteLine("Not a valid PDF file"); 
      return; 
   } 
 
   if (fileType == PDFFileType.PDF14) 
   { 
      Console.WriteLine("Is PDF 1.4 already"); 
      return; 
   } 
 
   // Not PDF 1.4, convert 
   Console.WriteLine("Converting to PDF 1.4"); 
   PDFFile file = new PDFFile(sourceFileName); 
   file.CompatibilityLevel = PDFCompatibilityLevel.PDF14; 
   file.Convert(1, -1, destFileName); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

See Also

Reference

Leadtools.Pdf Namespace

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

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.