Skip to content
ComPDF
DemoSampleAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

PDF Standard Format Conversion

ComPDF PDF SDK supports converting PDF documents to various PDF standard formats, including PDF/A (for long-term archiving), PDF/X (for printing), PDF/E (for engineering documents), PDF/UA (for accessibility), and PDF/VT (for variable data printing).

Convert to Standard PDF Format

Use the WriteStandardPDFToFilePath method to convert an existing PDF file to a specified PDF standard format. This method analyzes the content of the existing PDF file and makes a series of modifications to generate a document compliant with the target standard.

During the conversion process, features unsuitable for the target standard (such as encryption, outdated compression schemes, missing fonts, or device-dependent colors) will be replaced with standard-compliant equivalents. Since the conversion process applies only the necessary changes to the source file, minimal information loss occurs.

Method Signature:

c#
public bool WriteStandardPDFToFilePath(
    CPDFStandardType standardType,  // PDF standard type
    string iccFilePath,              // ICC color profile path (optional, leave empty for default)
    string saveFilePath,             // Output file save path
    CPDFUAConfig uaConfig = default  // PDF/UA configuration (only required for PDF/UA format)
)

Parameters:

ParameterTypeDescription
standardTypeCPDFStandardTypeTarget PDF standard type, containing format, version number, and subtype
iccFilePathstringICC color profile path. If the file does not exist, the default configuration file will be automatically selected based on the standard type
saveFilePathstringSave path for the converted document
uaConfigCPDFUAConfigPDF/UA configuration (optional), used to set document title and language

Example - Convert to PDF/A-1a:

c#
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");

// Configure the target standard type
CPDFStandardType standardType = new CPDFStandardType
{
    Format = CPDFStandardFormat.StandardPDFA,  // PDF/A format
    TypeNum = 1,                                // Version number 1
    Type = CPDFPartType.PDF_a                   // Subtype a
};

// Convert and save (using default ICC configuration file)
bool success = document.WriteStandardPDFToFilePath(standardType, "", "savePath");

Example - Convert to PDF/UA:

c#
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");

// Configure PDF/UA standard type
CPDFStandardType standardType = new CPDFStandardType
{
    Format = CPDFStandardFormat.StandardPDFUA,  // PDF/UA format
    TypeNum = 1,                                 // Version number 1
    Type = CPDFPartType.None
};

// Configure PDF/UA metadata
CPDFUAConfig uaConfig = new CPDFUAConfig
{
    Title = "Accessible Document",
    Language = CPDFUALanguage.en_US  // English (US)
};

// Convert and save
bool success = document.WriteStandardPDFToFilePath(standardType, "", "savePath", uaConfig);

Detect PDF Standard Type

Use the GetPDFStandardType method to detect whether a document currently conforms to a PDF standard format.

Method Signature:

c#
public CPDFStandardType GetPDFStandardType()

Return Value:

Returns a CPDFStandardType struct containing the following fields:

FieldTypeDescription
FormatCPDFStandardFormatPDF standard format (StandardPDF, StandardPDFA, StandardPDFX, etc.)
TypeNumintVersion number (e.g., TypeNum is 1 for PDF/A-1)
TypeCPDFPartTypeSubtype (PDF_a, PDF_b, PDF_u, or None)

Example:

c#
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");
CPDFStandardType standardType = document.GetPDFStandardType();

switch (standardType.Format)
{
    case CPDFStandardFormat.StandardPDF:
        Console.WriteLine("Standard PDF document");
        break;
    case CPDFStandardFormat.StandardPDFA:
        Console.WriteLine($"PDF/A-{standardType.TypeNum}{GetPartTypeSuffix(standardType.Type)} document");
        break;
    case CPDFStandardFormat.StandardPDFX:
        Console.WriteLine($"PDF/X-{standardType.TypeNum} document");
        break;
    case CPDFStandardFormat.StandardPDFUA:
        Console.WriteLine($"PDF/UA-{standardType.TypeNum} document");
        break;
    default:
        Console.WriteLine($"Other standard format: {standardType.Format}");
        break;
}

// Helper method: get subtype suffix
string GetPartTypeSuffix(CPDFPartType partType)
{
    return partType switch
    {
        CPDFPartType.PDF_a => "a",
        CPDFPartType.PDF_b => "b",
        CPDFPartType.PDF_u => "u",
        _ => ""
    };
}

PDF Standard Format Details

CPDFStandardFormat Enumeration

Enum ValueDescription
StandardPDFStandard PDF format (no specific standard)
StandardPDFAPDF/A format, for long-term archiving
StandardPDFXPDF/X format, for print exchange
StandardPDFEPDF/E format, for engineering documents
StandardPDFUAPDF/UA format, for universal accessibility
StandardPDFVTPDF/VT format, for variable data printing

CPDFPartType Enumeration

Enum ValueDescription
NoneNo subtype
PDF_aType a (full conformance, includes structural information)
PDF_bType b (basic conformance)
PDF_uType u (Unicode conformance)

CPDFUALanguage Enumeration (Partial)

Enum ValueDescription
unspecifiedUnspecified
zh_CNSimplified Chinese (Mainland China)
zh_TWTraditional Chinese (Taiwan)
en_USEnglish (United States)
en_GBEnglish (United Kingdom)
ja_JPJapanese (Japan)
ko_KRKorean (South Korea)
de_DEGerman (Germany)
fr_FRFrench (France)

PDF Standard Introduction

PDF standards are a series of PDF format specifications defined by the International Organization for Standardization (ISO), each optimized for specific use cases. ComPDFKit supports conversion to the following PDF standard formats.

PDF/A (Archiving Standard)

What is PDF/A?

PDF/A (Portable Document Format Archival) is a PDF file format standard specifically designed for the long-term preservation of electronic documents. Its purpose is to ensure that documents maintain readability and accessibility over time, meeting the requirements for archiving and long-term preservation.

PDF/A Versions

NameRelease DateStandardBased OnDescription
PDF/A-12005-09-28ISO 19005-1PDF 1.4Basic archiving format, divided into 1a (full conformance) and 1b (basic conformance)
PDF/A-22011-06-20ISO 19005-2PDF 1.7Supports JPEG2000, transparency, layers; adds 2u (Unicode) subtype
PDF/A-32012-10-15ISO 19005-3PDF 1.7Allows embedding of arbitrary file formats (e.g., XML, CAD)
PDF/A-42020-11ISO 19005-4PDF 2.0Based on the latest PDF 2.0, simplifies conformance levels

PDF/A Subtype Description

SubtypeCPDFPartTypeDescription
aPDF_aFull conformance, includes tag structure information, supports assistive technology access
bPDF_bBasic conformance, ensures visual appearance can be reproduced
uPDF_uUnicode conformance (PDF/A-2 and above), ensures text is searchable and extractable

Key Features of PDF/A

  • Self-Containment: The document contains all necessary resources (fonts, images, etc.), ensuring independent rendering.
  • Font Embedding: All fonts must be embedded to prevent display inconsistencies.
  • No Encryption: Encryption is not allowed to ensure long-term accessibility.
  • Metadata Requirements: Must include XMP metadata.
  • Color Management: Must use ICC color profiles or device-independent color spaces.

PDF/X (Print Exchange Standard)

What is PDF/X?

PDF/X (Portable Document Format Exchange) is a PDF standard designed for the printing industry, ensuring reliable document exchange and output across different printing workflows. It eliminates common technical issues in the printing process, such as missing fonts and color discrepancies.

PDF/X Versions

NameStandardPrimary Use
PDF/X-1aISO 15930-1CMYK and spot color printing, suitable for traditional printing workflows
PDF/X-3ISO 15930-3Color-managed printing, allows RGB and Lab color spaces
PDF/X-4ISO 15930-7Supports transparency and layers, suitable for modern printing workflows
PDF/X-5ISO 15930-8Supports external referenced content (OPI), for partial exchange scenarios

Key Features of PDF/X

  • Color Accuracy: Must use CMYK, spot colors, or color spaces with ICC profiles.
  • Font Embedding: All fonts must be embedded.
  • Bleed and Trim: Supports defining bleed areas (BleedBox) and trim areas (TrimBox).
  • No Transparency (X-1a/X-3): Earlier versions require flattened transparency.
  • Output Intent: Must include OutputIntent information specifying the target output device or condition.

Use Cases: Commercial printing, magazine publishing, packaging printing.


PDF/E (Engineering Document Standard)

What is PDF/E?

PDF/E (Portable Document Format Engineering) is a PDF standard designed for the engineering field, used for exchanging engineering documents, technical drawings, and 3D models.

PDF/E Versions

NameStandardKey Features
PDF/E-1ISO 24517-1Based on PDF 1.6, supports 3D content, layers, and annotations
PDF/E-2ISO 24517-2 (in development)Plans to support more engineering features

Key Features of PDF/E

  • 3D Support: Can embed 3D models in U3D and PRC formats.
  • Layer Support: Supports Optional Content Groups (OCG) for viewing different layers.
  • Precise Measurement: Supports geospatial coordinates and measurement units.
  • Large Format Support: Suitable for large-size pages in engineering drawings.
  • Annotations and Markups: Supports markups and annotations in engineering reviews.

Use Cases: CAD drawing exchange, architectural design, manufacturing technical documentation.


PDF/UA (Universal Accessibility Standard)

What is PDF/UA?

PDF/UA (Portable Document Format Universal Accessibility) is a PDF standard designed for universal accessibility, ensuring that people with disabilities (especially visually impaired users) can access PDF content through assistive technologies (such as screen readers).

PDF/UA Versions

NameStandardKey Features
PDF/UA-1ISO 14289-1Based on PDF 1.7, defines technical requirements for accessible access
PDF/UA-2ISO 14289-2 (2024)Based on PDF 2.0, enhanced support for mathematical formulas and annotations

Key Features of PDF/UA

  • Tag Structure: Must include a complete tag tree (Tagged PDF) defining the logical structure of content.
  • Reading Order: Content must have a correct reading order.
  • Alternative Text: Images and non-text content must provide alternative text descriptions.
  • Language Identification: Must specify the document language to support correct pronunciation by screen readers.
  • Heading Hierarchy: Headings must have a correct hierarchical structure.
  • Table Marking: Tables must have correct row/column markings.
  • Navigation Support: Supports bookmark and link navigation.

Use Cases: Government documents, educational materials, public service documents, documents required to comply with accessibility regulations.

PDF/VT (Variable Data Printing Standard)

What is PDF/VT?

PDF/VT (Portable Document Format Variable and Transactional) is a PDF standard designed for variable data printing (VDP), used for efficiently processing large-volume print jobs with personalized content, such as bills, direct mail letters, and personalized marketing materials.

PDF/VT Versions

NameStandardKey Features
PDF/VT-1ISO 16612-2Single-file exchange, contains all resources
PDF/VT-2ISO 16612-2Multi-file exchange, supports externally referenced resources

Key Features of PDF/VT

  • Document Part Metadata (DPM): Defines the logical structure of the document (e.g., recipients, page groups).
  • Resource Reuse: Supports efficient reuse of XObject resources, reducing file size.
  • Incremental Processing: Supports streaming processing, suitable for large-volume jobs.
  • Based on PDF/X-4: Inherits the printing features of PDF/X-4.
  • Variable Content Marking: Identifies static content and variable content areas.

Use Cases: Bill printing, personalized direct mail, bulk certificate generation, variable data marketing materials.


PDF Standard Comparison Summary

StandardPrimary UseKey FeaturesTypical Applications
PDF/ALong-term archivingSelf-contained, no encryption, font embeddingLegal documents, government archives, historical records
PDF/XPrint exchangeColor accuracy, output intent, bleed definitionCommercial printing, magazines, packaging
PDF/EEngineering documents3D support, layers, precise measurementCAD drawings, architectural design
PDF/UAUniversal accessibilityTag structure, alternative text, reading orderGovernment documents, educational materials
PDF/VTVariable printingResource reuse, batch processing, personalizationBills, direct mail, personalized marketing