Show / Hide Table of Contents

# Class PDFACompliance

PDFACompliance class is used to validate PDF documents for PDF/A (ISO 19005:1/2/3) compliance or to convert existing PDF files to PDF/A compliant documents.

The conversion option analyses the content of existing PDF files and performs a sequence of modifications in order to produce a PDF/A compliant document. Features that are not suitable for long-term archiving (such as encryption, obsolete compression schemes, missing fonts, or device-dependent color) are replaced with their PDF/A compliant equivalents. Because the conversion process applies only necessary changes to the source file, the information loss is minimal. Also, because the converter provides a detailed report for each change, it is simple to inspect changes and to determine whether the conversion loss is acceptable.

The validation option in PDF/A Manager can be used to quickly determine whether a PDF file fully complies with the PDF/A specification according to the international standard ISO 19005:1/2/3. For files that are not compliant, the validation option can be used to produce a detailed report of compliance violations as well as a list of relevant error objects.

Key Functions:

- Checks if a PDF file is compliant with PDF/A (ISO 19005-1) specification.
- Converts any PDF to a PDF/A compliant document.
- Supports PDF/A-1a, PDF/A-1b, PDF/A-2b.
- Produces a detailed report of compliance violations and associated PDF objects.
- Keeps the required changes a minimum, preserving the consistency of the original.
- Tracks all changes to allow for automatic assessment of data loss.
- Allows user to customize compliance checks or omit specific changes.
- Preserves tags, logical structure, and color information in existing PDF documents.
- Offers automatic font substitution, embedding, and subsetting options.
- Supports automation and batch operation. PDF/A Converter is designed to be used in unattended mode in high throughput server or batch environments

##### Inheritance

object
PDFACompliance

##### Implements

IDisposable

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.PDF.PDFA

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class PDFACompliance : IDisposable

### Constructors

#### PDFACompliance(bool, byte[], string, Conformance, ErrorCode[], int, bool)

##### Declaration

    public PDFACompliance(bool convert, byte[] buf, string password, PDFACompliance.Conformance conf, PDFACompliance.ErrorCode[] exceptions, int max_ref_objs, bool first_stop)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | convert |
byte[] | buf |
string | password |
PDFACompliance.Conformance | conf |
ErrorCode[] | exceptions |
int | max_ref_objs |
bool | first_stop |

#### PDFACompliance(bool, byte[], PDFAOptions)

##### Declaration

    public PDFACompliance(bool convert, byte[] buf, PDFAOptions in_options)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | convert |
byte[] | buf |
PDFAOptions | in_options |

#### PDFACompliance(bool, string, string, Conformance, ErrorCode[], int, bool)

##### Declaration

    public PDFACompliance(bool convert, string file_path, string password, PDFACompliance.Conformance conf, PDFACompliance.ErrorCode[] exceptions, int max_ref_objs, bool first_stop)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | convert |
string | file_path |
string | password |
PDFACompliance.Conformance | conf |
ErrorCode[] | exceptions |
int | max_ref_objs |
bool | first_stop |

#### PDFACompliance(bool, string, PDFAOptions)

##### Declaration

    public PDFACompliance(bool convert, string file_path, PDFAOptions in_options)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | convert |
string | file_path |
PDFAOptions | in_options |

### Methods

#### Destroy()

##### Declaration

    public void Destroy()

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing |

#### ~PDFACompliance()

##### Declaration

    protected ~PDFACompliance()

#### GetDeclaredConformance(PDFDoc)

Retrieves whether document's XMP metadata claims PDF/A conformance and to what part and level.

##### Declaration

    public static PDFACompliance.Conformance GetDeclaredConformance(PDFDoc in_doc)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFDoc | in_doc | the document.

##### Returns

Type | Description
--- | ---
PDFACompliance.Conformance | Presumptive PDFA part number and conformance level, as an enumerated value.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetError(int)

Gets the error.

##### Declaration

    public PDFACompliance.ErrorCode GetError(int idx)

##### Parameters

Type | Name | Description
--- | --- | ---
int | idx | The index in the array of error code identifiers. The array is indexed starting from zero.

##### Returns

Type | Description
--- | ---
PDFACompliance.ErrorCode | The error identifier.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetErrorCount()

Gets the error count.

##### Declaration

    public int GetErrorCount()

##### Returns

Type | Description
--- | ---
int | The number of compliance violations.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetPDFAErrorMessage(ErrorCode)

Gets the pDFA error message.

##### Declaration

    public static string GetPDFAErrorMessage(PDFACompliance.ErrorCode id)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFACompliance.ErrorCode | id | error code identifier (obtained using GetError() method).

##### Returns

Type | Description
--- | ---
string | A descriptive error message for the given error identifier.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetRefObj(ErrorCode, int)

Gets the ref obj.

##### Declaration

    public int GetRefObj(PDFACompliance.ErrorCode id, int obj_idx)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFACompliance.ErrorCode | id | error code identifier (obtained using GetError() method).
int | obj_idx | the obj_idx

##### Returns

Type | Description
--- | ---
int | A specific object reference associated with a given error type. The return value is a PDF object identifier (i.e. object number for 'pdftron.SDF.Obj)) for the that is associated with the error.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetRefObjCount(ErrorCode)

Gets the error.

##### Declaration

    public int GetRefObjCount(PDFACompliance.ErrorCode id)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFACompliance.ErrorCode | id | The index in the array of error code identifiers. The array is indexed starting from zero.

##### Returns

Type | Description
--- | ---
int | The error identifier.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SaveAs(bool)

Serializes the converted PDF/A document to a memory buffer.

##### Declaration

    public byte[] SaveAs(bool linearized)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | linearized | An optional flag used to specify whether the resulting PDF/A document should be web-optimized (linearized).

##### Returns

Type | Description
--- | ---
byte[] | Byte array containing the serialized version of the document

##### Remarks

This method assumes that the first parameter passed in PDFACompliance constructor (i.e. the convert parameter) is set to 'true'.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SaveAs(Stream, bool)

Serializes the converted PDF/A document to a stream.

##### Declaration

    public void SaveAs(Stream stm, bool linearized)

##### Parameters

Type | Name | Description
--- | --- | ---
Stream | stm | A stream where to serialize the document.
bool | linearized | An optional flag used to specify whether the resulting PDF/A document should be web-optimized (linearized).

##### Remarks

This method assumes that the first parameter passed in PDFACompliance constructor (i.e. the convert parameter) is set to 'true'.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SaveAs(string, bool)

Serializes the converted PDF/A document to a file on disk.

##### Declaration

    public void SaveAs(string file_path, bool linearized)

##### Parameters

Type | Name | Description
--- | --- | ---
string | file_path | the file_path
bool | linearized | An optional flag used to specify whether the resulting PDF/A document should be web-optimized (linearized).

##### Remarks

This method assumes that the first parameter passed in PDFACompliance constructor (i.e. the convert parameter) is set to 'true'.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable