PDF/A Export

12 September 2016

We recently discovered some issues when exporting a PDF/A-2b type document in relation to the ISO 19005-2 standard.

  • The document is not PDF/A compatible if it contains fonts without embedded font programs. 
  • The document is converted to PDF/A-3b if any attachments are present. 
  • The document is not PDF/A compatible if it is encrypted.

The team worked hard to address these bugs and I am pleased to announce, starting with version 16.2, the following changes have been made:

  • The PdfACompatibility enumeration has been expanded. It now contains “PdfA1b”, “PdfA2b” and “PdfA3b” values, which conform to restrictions imposed by PDF/A-1b (ISO 19005-1), PDF/A-2b (ISO 19005-2) and PDF/A-3b (ISO 19005-3) standards.  In addition, the enumeration contains the “None” value which conforms to ISO 32000-1 standard without any restrictions. 
  • The PDF Export Settings dialog no longer allows you to specify incorrect options. 
  • PdfExportOptions are validated before export. This may result in an exception because some of the options are mutually exclusive. 
  • A new Validate() method has been added to check the validity of PdfExportOptions. It returns a list of any detected inconsistencies.

The sample below illustrates how to use this new method:

[C#]

using (XtraReport report = new XtraReport()) {
    PdfExportOptions options = new PdfExportOptions();
    options.PdfACompatibility = PdfACompatibility.PdfA1b;
    options.PasswordSecurityOptions.PermissionsPassword = "pwd";
    options.ShowPrintDialogOnOpen = true;
    IList<string> result = options.Validate();
    if (result.Count > 0)
        Console.WriteLine(String.Join(Environment.NewLine, result));
    else
        report.ExportToPdf("Result.pdf", options);
}

[VB.NET]

Using report As New XtraReport()
    Dim options As New PdfExportOptions()
    options.PdfACompatibility = PdfACompatibility.PdfA1b
    options.PasswordSecurityOptions.PermissionsPassword = "pwd"
    options.ShowPrintDialogOnOpen = True
    Dim result As IList(Of String) = options.Validate()
    If result.Count > 0 Then
        Console.WriteLine([String].Join(Environment.NewLine, result))
    Else
        report.ExportToPdf("Result.pdf", options)
    End If
End Using

Version 16.2 will also allow you to create documents conforming to the following standards which will require you to validate all export options.

  • PDF (ISO 32000-1) 
  • PDF/A-1b (ISO19005 - 1) 
  • PDF /A-2b (ISO19005 - 2) 
  • PDF/ A-3b (ISO19005 - 3)

For the current versions of the library, you need to consider the following restrictions associated with PDF/A compatibility:

  • All PDF/A versions implicitly prohibit encryption. 
  • All fonts that are used in PDF/A documents should be embedded. 
  • The PDF/A-1b and PDF/A-2b standards do not support attachments. 
  • The PDF/A-1b standard does not support transparency and the alpha channel in images will be ignored.


It is great to see the PDF library being used in so many scenarios. Please feel free to provide any feedback directly to me, or via the support centre here.

no comments
No Comments

Please login or register to post comments.