PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
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).
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:
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:
| Parameter | Type | Description |
|---|---|---|
| standardType | CPDFStandardType | Target PDF standard type, containing format, version number, and subtype |
| iccFilePath | string | ICC color profile path. If the file does not exist, the default configuration file will be automatically selected based on the standard type |
| saveFilePath | string | Save path for the converted document |
| uaConfig | CPDFUAConfig | PDF/UA configuration (optional), used to set document title and language |
Example - Convert to PDF/A-1a:
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:
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);Use the GetPDFStandardType method to detect whether a document currently conforms to a PDF standard format.
Method Signature:
public CPDFStandardType GetPDFStandardType()Return Value:
Returns a CPDFStandardType struct containing the following fields:
| Field | Type | Description |
|---|---|---|
| Format | CPDFStandardFormat | PDF standard format (StandardPDF, StandardPDFA, StandardPDFX, etc.) |
| TypeNum | int | Version number (e.g., TypeNum is 1 for PDF/A-1) |
| Type | CPDFPartType | Subtype (PDF_a, PDF_b, PDF_u, or None) |
Example:
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",
_ => ""
};
}| Enum Value | Description |
|---|---|
| StandardPDF | Standard PDF format (no specific standard) |
| StandardPDFA | PDF/A format, for long-term archiving |
| StandardPDFX | PDF/X format, for print exchange |
| StandardPDFE | PDF/E format, for engineering documents |
| StandardPDFUA | PDF/UA format, for universal accessibility |
| StandardPDFVT | PDF/VT format, for variable data printing |
| Enum Value | Description |
|---|---|
| None | No subtype |
| PDF_a | Type a (full conformance, includes structural information) |
| PDF_b | Type b (basic conformance) |
| PDF_u | Type u (Unicode conformance) |
| Enum Value | Description |
|---|---|
| unspecified | Unspecified |
| zh_CN | Simplified Chinese (Mainland China) |
| zh_TW | Traditional Chinese (Taiwan) |
| en_US | English (United States) |
| en_GB | English (United Kingdom) |
| ja_JP | Japanese (Japan) |
| ko_KR | Korean (South Korea) |
| de_DE | German (Germany) |
| fr_FR | French (France) |
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.
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
| Name | Release Date | Standard | Based On | Description |
|---|---|---|---|---|
| PDF/A-1 | 2005-09-28 | ISO 19005-1 | PDF 1.4 | Basic archiving format, divided into 1a (full conformance) and 1b (basic conformance) |
| PDF/A-2 | 2011-06-20 | ISO 19005-2 | PDF 1.7 | Supports JPEG2000, transparency, layers; adds 2u (Unicode) subtype |
| PDF/A-3 | 2012-10-15 | ISO 19005-3 | PDF 1.7 | Allows embedding of arbitrary file formats (e.g., XML, CAD) |
| PDF/A-4 | 2020-11 | ISO 19005-4 | PDF 2.0 | Based on the latest PDF 2.0, simplifies conformance levels |
PDF/A Subtype Description
| Subtype | CPDFPartType | Description |
|---|---|---|
| a | PDF_a | Full conformance, includes tag structure information, supports assistive technology access |
| b | PDF_b | Basic conformance, ensures visual appearance can be reproduced |
| u | PDF_u | Unicode conformance (PDF/A-2 and above), ensures text is searchable and extractable |
Key Features of PDF/A
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
| Name | Standard | Primary Use |
|---|---|---|
| PDF/X-1a | ISO 15930-1 | CMYK and spot color printing, suitable for traditional printing workflows |
| PDF/X-3 | ISO 15930-3 | Color-managed printing, allows RGB and Lab color spaces |
| PDF/X-4 | ISO 15930-7 | Supports transparency and layers, suitable for modern printing workflows |
| PDF/X-5 | ISO 15930-8 | Supports external referenced content (OPI), for partial exchange scenarios |
Key Features of PDF/X
Use Cases: Commercial printing, magazine publishing, packaging printing.
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
| Name | Standard | Key Features |
|---|---|---|
| PDF/E-1 | ISO 24517-1 | Based on PDF 1.6, supports 3D content, layers, and annotations |
| PDF/E-2 | ISO 24517-2 (in development) | Plans to support more engineering features |
Key Features of PDF/E
Use Cases: CAD drawing exchange, architectural design, manufacturing technical documentation.
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
| Name | Standard | Key Features |
|---|---|---|
| PDF/UA-1 | ISO 14289-1 | Based on PDF 1.7, defines technical requirements for accessible access |
| PDF/UA-2 | ISO 14289-2 (2024) | Based on PDF 2.0, enhanced support for mathematical formulas and annotations |
Key Features of PDF/UA
Use Cases: Government documents, educational materials, public service documents, documents required to comply with accessibility regulations.
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
| Name | Standard | Key Features |
|---|---|---|
| PDF/VT-1 | ISO 16612-2 | Single-file exchange, contains all resources |
| PDF/VT-2 | ISO 16612-2 | Multi-file exchange, supports externally referenced resources |
Key Features of PDF/VT
Use Cases: Bill printing, personalized direct mail, bulk certificate generation, variable data marketing materials.
| Standard | Primary Use | Key Features | Typical Applications |
|---|---|---|---|
| PDF/A | Long-term archiving | Self-contained, no encryption, font embedding | Legal documents, government archives, historical records |
| PDF/X | Print exchange | Color accuracy, output intent, bleed definition | Commercial printing, magazines, packaging |
| PDF/E | Engineering documents | 3D support, layers, precise measurement | CAD drawings, architectural design |
| PDF/UA | Universal accessibility | Tag structure, alternative text, reading order | Government documents, educational materials |
| PDF/VT | Variable printing | Resource reuse, batch processing, personalization | Bills, direct mail, personalized marketing |