public PDFCompatibilityLevel CompatibilityLevel { get; set; } public PDFCompatibilityLevel getCompatibilityLevel();public void setCompatibilityLevel(PDFCompatibilityLevel pDFCompatibilityLevel);
public:property PDFCompatibilityLevel CompatibilityLevel {PDFCompatibilityLevel get();void set ( PDFCompatibilityLevel );}
CompatibilityLevel # get and set (PDFFile)
A PDFCompatibilityLevel that specifies the PDF compatibility level (version) to use when this PDFFile is used to update or create a PDF file. Default value is PDFCompatibilityLevel.Default.
The following methods of the PDFFile class will use the level set in CompatibilityLevel when updating or creating a PDF file:
Similar to the DocumentProperties property, the value of CompatibilityLevel will not be modified when a PDF file is loaded in this object using the Load method. To get the version of a PDF file, use the PDFFile.GetPDFFileType method.
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 filePDFFileType 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, convertConsole.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:\LEADTOOLS23\Resources\Images";}
import java.io.ByteArrayInputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.FileReader;import java.io.IOException;import java.io.InputStream;import java.nio.file.Files;import java.nio.file.Paths;import java.nio.file.StandardCopyOption;import java.util.ArrayList;import java.util.Date;import java.util.List;import java.util.Scanner;import org.junit.*;import org.junit.runner.JUnitCore;import org.junit.runner.Result;import org.junit.runner.notification.Failure;import static org.junit.Assert.*;import leadtools.*;import leadtools.codecs.*;import leadtools.pdf.*;public void pdfFileCompatibilityLevelExample() {final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images";String sourceFileName = combine(LEAD_VARS_IMAGES_DIR, "Leadtools.pdf");String destFileName = combine(LEAD_VARS_IMAGES_DIR, "LEAD_14.pdf");// Check the version of the source filePDFFileType fileType = PDFFile.getPDFFileType(sourceFileName, true);if (fileType == PDFFileType.UNKNOWN) {System.out.println("Not a valid PDF file");return;}if (fileType == PDFFileType.PDF14) {System.out.println("Is PDF 1.4 already");return;}// Not PDF 1.4, convertSystem.out.println("Converting to PDF 1.4");PDFFile file = new PDFFile(sourceFileName);file.setCompatibilityLevel(PDFCompatibilityLevel.PDF14);file.convert(1, -1, destFileName);assertTrue(PDFFile.getPDFFileType(destFileName, true) == PDFFileType.PDF14);}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
