Accusoft.PdfXpressSdk Namespace > Document Class : ConvertToPdfA Method |
Apply ISO 19005-1:2005 restrictions and prohibitions to convert a candidate PDF document to PDF/A.
If the candidate PDF document violates a restriction or prohibition, PDF Xpress may attempt to apply an automatic fix-up to satisfy compliance. If a detected violation is not fixed, then the conversion process will raise an exception that describes the nature of the failure.
PDF Xpress PDF/A conversion support is limited to new image-only PDFs. Image-only PDFs lack searchable text content, but require only honoring a subset of PDF/A-1b compliance rules. Consequently, converting a candidate PDF document to PDF/A-1b is guaranteed to fail if any of the following is true—
The candidate was opened from the file system or from memory.
Pages from another PDF document are inserted into the candidate.
XFDF is imported into the candidate.
A watermark is added to the candidate.
PDF/A compliance is not guaranteed if changes are made to the PDF document after conversion has succeeded.
Refer to ISO 19005-1:2005 Document management — Electronic document file format for long-term preservation — Part 1: Use of PDF 1.4 (PDF/A-1)
Specify a well-formed ICC profile using either a filename or a local memory buffer. The ICC profile filename will be ignored if a local memory buffer is provided.
'Declaration Public Sub ConvertToPdfA( _ ByVal options As ConvertOptions _ )
'Usage Dim instance As Document Dim options As ConvertOptions instance.ConvertToPdfA(options)
public void ConvertToPdfA( ConvertOptions options )
public: void ConvertToPdfA( ConvertOptions* options )
public: void ConvertToPdfA( ConvertOptions^ options )
Exception | Description |
---|---|
PdfXpressLicensingException | Raised if this feature is not available for the active licese edition |
PdfXpressLibraryException | Raised if the conversion activity encounters an unrecoverable failure. Raised if an ICC profile is required but not provided. |
System.ArgumentNullException | Raised if the options parameter is null. |
System.IO.FileNotFoundException | Raised if ICC profile filename is specified and not found. |
System.IO.PathTooLongException | |
System.IO.DirectoryNotFoundException | |
System.ArgumentException |
If the candidate PDF document violates a restriction or prohibition, PDF Xpress may attempt to apply an automatic fix-up to satisfy compliance. If a detected violation is not fixed, then the conversion process will raise an exception that describes the nature of the failure.
PDF Xpress PDF/A conversion support is limited to new image-only PDFs. Image-only PDFs lack searchable text content, but require only honoring a subset of PDF/A-1b compliance rules. Consequently, converting a candidate PDF document to PDF/A-1b is guaranteed to fail if any of the following is true—
PDF/A compliance is not guarenteed if changes are made to the PDF document after conversion has succeeded.
Refer to ISO 19005-1:2005 Document management — Electronic document file format for long-term preservation — Part 1: Use of PDF 1.4 (PDF/A-1)
Specify a well-formed ICC profile using either a filename or a local memory buffer. The ICC profile filename will be ignored if a local memory buffer is provided.
namespace Snippets { using System ; using System.Windows.Forms ; using System.Diagnostics ; using Accusoft.PdfXpress7.Net ; public partial class PdfXpressSnippets { public void ConvertDocumentToPdfA1b( Document document , String saveFilename ) { // Convert to PDF/A Level B conformance using RGB ICC profile. // ConvertOptions convertOptions = new ConvertOptions( ) ; convertOptions.PdfType = PdfType.pdfA1b; convertOptions.IccProfileFilename = "sRGB_v4_ICC_preference.icc"; // Save conforming document to local file system // SaveOptions saveOptions = new SaveOptions( ) ; saveOptions.Filename = saveFilename ; try { document.ConvertToPdfA ( convertOptions ) ; document.Save ( saveOptions ) ; } catch ( Exception e ) { Debug.Assert ( false , e.ToString( ) ) ; } } } }