←Select platform

FileType Property

Summary
Gets the file type or version of this PDF document.
Syntax
C#
C++/CLI
Java
Python
public PDFFileType FileType { get; } 
public PDFFileType getFileType(); 
public: 
property PDFFileType FileType { 
   PDFFileType get(); 
} 
FileType # get  (PDFDocument) 

Property Value

A PDFFileType enumeration member that specifies the file type of version of the PDF file associated with this PDFDocument. The default value is PDFFileType.Unknown.

Remarks

The file type or version is automatically read from the PDF file when the PDFDocument is constructed.

To convert a PDF file to another version, use the PDFFile.Convert method.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
using Leadtools.WinForms; 
 
 
public void PDFDocumentExample() 
{ 
   string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
 
   // Create a PDF document for file 
   using (PDFDocument document = new PDFDocument(pdfFileName)) 
   { 
 
      // Show the file type and properties 
      Console.WriteLine("File type is : {0}", document.FileType); 
      Console.WriteLine("Contains : {0} pages", document.Pages.Count); 
      Console.WriteLine("----------:"); 
      foreach (PDFDocumentPage page in document.Pages) 
      { 
         Console.WriteLine("Page: {0}, size: {1} by {2} ({3} by {4} inches)", page.PageNumber, page.Width, page.Height, page.WidthInches, page.HeightInches); 
      } 
 
      PDFDocumentProperties props = document.DocumentProperties; 
      Console.WriteLine("Properties:"); 
      Console.WriteLine("----------:"); 
      Console.WriteLine("Title: {0}", props.Title); 
      Console.WriteLine("Author: {0}", props.Author); 
      Console.WriteLine("Subject: {0}", props.Subject); 
      Console.WriteLine("Keywords: {0}", props.Keywords); 
      Console.WriteLine("Creator: {0}", props.Creator); 
      Console.WriteLine("Producer: {0}", props.Producer); 
      Console.WriteLine("Created: {0}", props.Created); 
      Console.WriteLine("Modified: {0}", props.Modified); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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.