ImageGear .NET provides the ImGearPDFPreflight.Convert method to run an automatic PDF to PDF/A conversion, with or without preceding verification.
This method changes the original PDF document (in memory) by fixing all Fixable incompliance nodes. If all incompliance nodes in a PDF document are fixable, that PDF document will be converted into a PDF/A compliant document. The converter report is returned as a tree, grouped by the common document part and the pages. Each node in the report tree represented by ImGearPDFPreflightReport class corresponds to incompliance with PDF/A standard. All fixed incompliance nodes in the report provide details of the corresponding fix.
This version of the ImageGear .NET PDF component allows PDF to PDF/A conversion for all PDF files produced directly from raster files by saving them to PDF with ImageGear .NET. The following automatic fixes are done during this conversion:
Problem Area |
Fix Description |
---|---|
OutputIntent |
All uncalibrated color spaces are replaced with a provided color profile (must be RGB or CMYK). Note that images may be converted to a new color space, which could change the file size. Particularly, the bit depth and compression of the 1-bit images will be changed to either 24- or 32-bits per pixel. |
LZW and JPEG 2000 Compression |
Since LZW and JPEG 2000 compressions are prohibited in PDF/A compliant files, all LZW and JPEG 2000 streams in PDF document are recompressed, which would change the file size. |
Header and Metadata |
ImageGear .NET automatically fills in all values in PDF document headers to ensure PDF/A compliance. |
There are two ways to save converted PDF/A documents. Choose one of the following methods described below that best fits into your current workflow:
If you need to convert a PDF document to PDF/A quickly, without displaying it or otherwise working with it, then saving the PDF document with the ImGearFileFormats.SaveDocument method is the best choice. See the Load and Save a PDF topic for an example on how to convert a document to PDF/A using this method.
Alternatively, the ImGearPDFDocument.Save method can be used if your application uses a manual process for converting PDF documents to PDF/A or performs other actions on the PDF opened in memory. In this case, the ImGearPDFPreflight.Convert method must be called on the document before it is saved. When you are ready, call the ImGearPDFDocument.Save method to save the changes in the PDF/A document to a file or memory stream.
This process is convenient when using ImageGear.Recognition to create searchable image PDFs that are PDF/A compliant. See the Exporting to a PDF Output Document topic for an example of how to do this.
The following example illustrates how a PDF document can be converted to a PDF document compliant with the PDFA-1a standard.