Accusoft.PdfXpress7.Net
ConvertToPdfA Method
Example 




Options to direct conversion to PDF/A

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.

Syntax
'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
) 

Parameters

options
Options to direct conversion to PDF/A
Exceptions
ExceptionDescription
PdfXpressLicensingExceptionRaised if this feature is not available for the active licese edition
PdfXpressLibraryExceptionRaised if the conversion activity encounters an unrecoverable failure. Raised if an ICC profile is required but not provided.
System.ArgumentNullExceptionRaised if the options parameter is null.
System.IO.FileNotFoundExceptionRaised if ICC profile filename is specified and not found.
System.IO.PathTooLongExceptionThe exception that is thrown when a path or file name is longer than the system-defined maximum length.
System.IO.DirectoryNotFoundExceptionThe exception that is thrown when part of a file or directory cannot be found.
System.ArgumentExceptionThe exception that is thrown when one of the arguments provided to a method is not valid.
Remarks

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.

Example
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( ) ) ;
            }
        }
    }
}
See Also

Reference

Document Class
Document Members

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback