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
System.Object
PDFACompliance
Namespace: pdftron.PDF.PDFA
Assembly: PDFNetAndroid.dll
Syntax
public class PDFACompliance : IDisposable

Constructors

PDFACompliance(Boolean, Byte[], PDFAOptions)

Declaration
public PDFACompliance(bool convert, byte[] buf, PDFAOptions in_options)
Parameters
Type Name Description
System.Boolean convert
System.Byte[] buf
PDFAOptions in_options

PDFACompliance(Boolean, Byte[], String, PDFACompliance.Conformance, PDFACompliance.ErrorCode[], Int32, Boolean)

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
System.Boolean convert
System.Byte[] buf
System.String password
PDFACompliance.Conformance conf
PDFACompliance.ErrorCode[] exceptions
System.Int32 max_ref_objs
System.Boolean first_stop

PDFACompliance(Boolean, String, PDFAOptions)

Declaration
public PDFACompliance(bool convert, string file_path, PDFAOptions in_options)
Parameters
Type Name Description
System.Boolean convert
System.String file_path
PDFAOptions in_options

PDFACompliance(Boolean, String, String, PDFACompliance.Conformance, PDFACompliance.ErrorCode[], Int32, Boolean)

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
System.Boolean convert
System.String file_path
System.String password
PDFACompliance.Conformance conf
PDFACompliance.ErrorCode[] exceptions
System.Int32 max_ref_objs
System.Boolean first_stop

Methods

Destroy()

Declaration
public void Destroy()

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Finalize()

Declaration
protected void Finalize()

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(Int32)

Gets the error.

Declaration
public PDFACompliance.ErrorCode GetError(Int32 idx)
Parameters
Type Name Description
Int32 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 Int32 GetErrorCount()
Returns
Type Description
Int32

The number of compliance violations.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

GetPDFAErrorMessage(PDFACompliance.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
System.String

A descriptive error message for the given error identifier.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

GetRefObj(PDFACompliance.ErrorCode, Int32)

Gets the ref obj.

Declaration
public Int32 GetRefObj(PDFACompliance.ErrorCode id, Int32 obj_idx)
Parameters
Type Name Description
PDFACompliance.ErrorCode id

error code identifier (obtained using GetError() method).

Int32 obj_idx

the obj_idx

Returns
Type Description
Int32

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(PDFACompliance.ErrorCode)

Gets the error.

Declaration
public Int32 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
Int32

The error identifier.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SaveAs(Boolean)

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

Declaration
public byte[] SaveAs(bool linearized)
Parameters
Type Name Description
System.Boolean linearized

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

Returns
Type Description
System.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(System.IO.Stream, Boolean)

Serializes the converted PDF/A document to a stream.

Declaration
public void SaveAs(System.IO.Stream stm, bool linearized)
Parameters
Type Name Description
System.IO.Stream stm

A stream where to serialize the document.

System.Boolean 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, Boolean)

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

Declaration
public void SaveAs(string file_path, bool linearized)
Parameters
Type Name Description
System.String file_path

the file_path

System.Boolean 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

In This Article
Back to top Generated by DocFX