Leadtools.Pdf Namespace : PDFCompatibilityLevel Enumeration |
[SerializableAttribute()] public enum PDFCompatibilityLevel : System.Enum
'Declaration <SerializableAttribute()> Public Enum PDFCompatibilityLevel Inherits System.Enum
'Usage Dim instance As PDFCompatibilityLevel
[SerializableAttribute()] public enum PDFCompatibilityLevel : System.Enum
Leadtools.Pdf.PDFCompatibilityLevel = function() { }; Leadtools.Pdf.PDFCompatibilityLevel.prototype = {
LeadtoolsMemberMarker(replace me) };
[SerializableAttribute()] public enum class PDFCompatibilityLevel : public System.Enum
Member | Description |
---|---|
Default | Default (PDF version 1.5) |
PDF12 | PDF version 1.2 |
PDF13 | PDF version 1.3 |
PDF14 | PDF version 1.4 |
PDF15 | PDF version 1.5 |
PDFA | PDF/A |
The PDFCompatibilityLevel enumeration member is used as the type for the PDFFile.CompatibilityLevel property and is used to determine the compatibility (or version) level to use when creating or updating PDF files.
The following methods of the PDFFile class will use PDFFile.CompatibilityLevel when creating the new or updating the an existing PDF file :
Public Sub PDFCompatibilityLevelExample() Dim sourceFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "LEAD.pdf") Dim destFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "LEAD_14.pdf") ' Check the version of the source file Dim fileType As PDFFileType = PDFFile.GetPDFFileType(sourceFileName, True) If fileType = PDFFileType.Unknown Then Console.WriteLine("Not a valid PDF file") Return End If If fileType = PDFFileType.PDF14 Then Console.WriteLine("Is PDF 1.4 already") Return End If ' Not PDF 1.4, convert Console.WriteLine("Converting to PDF 1.4") Dim pdfFileObj As New PDFFile(sourceFileName) pdfFileObj.CompatibilityLevel = PDFCompatibilityLevel.PDF14 pdfFileObj.Convert(1, -1, destFileName) End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
public void PDFCompatibilityLevelExample() { string sourceFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD.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:\Users\Public\Documents\LEADTOOLS Images"; }
System.Object
System.ValueType
System.Enum
Leadtools.Pdf.PDFCompatibilityLevel
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