Convert PDF to PDF/A3u

Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.

Moderator: Alex

Post Reply
marcel
Posts: 5
Joined: Tue Mar 16, 2021 1:58 pm

Convert PDF to PDF/A3u

Post by marcel »

Hi,

We have a PDF document generated by MS Word. The conformance level is PDF A3-A.
We are obliged to provide PDF A3u.

If I verify the document with "PdfDocumentConformance.PdfA_3u" the result is "true", even though the claimed level is A3-A.
If I do convert the file to A3u the result is still A3-A.

It seems that everything conforms to A3u but only the conformance level refers to A3-A.

How can I make the conformance level property also become A3u?

Verify code:

Code: Select all

private static int VerifyDocument(System.IO.Stream stream) {
    PdfDocumentVerifier verifier = PdfAVerifier.Create(PdfDocumentConformance.PdfA_3u);
    using (ProcessingState state = new ProcessingState()) {
        using (VerificationProfileResult result = verifier.Verify(stream, state)) {
            if (result.IsPassed) {
                //passed A3-A
                return 0;
            } else {
                //...
            }
        }
    }
    return -1;
}
Convert code:

Code: Select all

private static int ConvertDocument(System.IO.Stream stream) {
    PdfDocumentConverter converter = PdfAConverter.Create(PdfDocumentConformance.PdfA_3u);
    using (ProcessingState state = new ProcessingState()) {
        using (ConversionProfileResult result = converter.Convert(stream, state)) {
            if (result.IsSuccessful) {
                //Successful but still A3-A
                return 0;
            } else {
                //...
            }
        }
    }
    return -1;
}
Alex
Site Admin
Posts: 1999
Joined: Thu Jul 10, 2008 2:21 pm

Re: Convert PDF to PDF/A3u

Post by Alex »

Hi,

PDF/A-3u and PDF/A-3b are subsets of PDF/A-3a, i.e. any PDF/A-3a conforms PDF/A-3u and PDF/A-3b standard.
Here is text from ISO 19005-3 specification:
===
Level A conforming files shall adhere to all of the requirements of this part of ISO 19005.
Level B conforming files shall adhere to all of the requirements of this part of ISO 19005 except those of 6.2.11.7 and 6.7.
Level U conforming files shall adhere to all of the requirements of this part of ISO 19005 except those of 6.7.
===

VintaSoft PDF/A converter does not change PDF/A conformance level in your PDF document because PDF/A-3a document is also PDF/A-3u document.

If you want to change the PDF/A conformance level during conversion to PDF/A, you need to delete metadata of PDF document before conversion to PDF/A:

Code: Select all

private static void ConvertDocumentToPdfA3u(System.IO.Stream stream)
{
    // create PDF/A-3u converter
    Vintasoft.Imaging.Pdf.Processing.PdfDocumentConverter converter =
        Vintasoft.Imaging.Pdf.Processing.PdfA.PdfAConverter.Create(PdfDocumentConformance.PdfA_3u);
    // create object that stores state of PDF/A conversion process
    using (Vintasoft.Imaging.Processing.ProcessingState state = new Vintasoft.Imaging.Processing.ProcessingState())
    {
        // open PDF document
        using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(stream))
        {
            // delete metadata of PDF document
            document.Catalog.Metadata = null;
            
            // convert document to PDF/A-3u
            using (Vintasoft.Imaging.Processing.ConversionProfileResult result = converter.Convert(document, state))
            {
                // if document is not converted
                if (!result.IsSuccessful)
                    throw result.CreateConversionException();
            }
            // save converted document
            document.Save(stream);
        }
    }
}
Best regards, Alexander
marcel
Posts: 5
Joined: Tue Mar 16, 2021 1:58 pm

Re: Convert PDF to PDF/A3u

Post by marcel »

Thank you for the explanation.
I didn't know this.

Regards,
Marcel
Post Reply