PDF/A-2U conversion with XFA is not compliant

Hi,
I have a Pdf with XFA that I want to convert to PDF/A-2U. The conversion seems to work, but the converted document is not PDF A compliant. How can I make the document valid? Can a Pdf with XFA even be Pdf-A compliant? Or does the XFA have to be converted to Acro Forms first?
The pdf also have an encryption? Ist that a problem?

d5-protokoll-testdata.pdf (793.9 KB)

@jan.net

Can you please provide more details about the specific errors or issues you are encountering with the PDF/A-2U compliance after conversion? Additionally, please clarify if you have tried converting the XFA to Acro Forms before the PDF/A conversion.

For the conversion I used

document.Convert(new MemoryStream(), PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);

But the converted document is not PDF/A. I checked with Online Pdf Validator and veraPdf.
The XFA form is a problem as mentioned in the report:

VeraReport.JPG (111.7 KB)

My next attempt was to convert the XFA to Acro forms, but setting the form type gave multiple System.NullReferenceException.

Here is my implementation:

public byte[] ConvertToPdfA(byte[] file)
{
    using (var pdfStream = new MemoryStream())
    {
        Document document;
        using (var documentStream = new MemoryStream())
        {
            documentStream.Write(file, 0, file.Length);
            document = new Document(documentStream);

            // Adobe XML Forms Architecture (XFA) in Acro Forms konvertieren (für Edge support)
            if (document.Form.Type == FormType.Dynamic)
            {
                document.Form.Type = FormType.Standard; // <-- throws System.NullReferenceException
            }

            document.Convert(new MemoryStream(), PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);

            document.Save(pdfStream);
        }

        var convertedFile = pdfStream.ToArray();

        return convertedFile;
    }
}

@jan.net
Yes, you should perform a normalization before converting.
And the fact that an exception occurs in the line

is a bug in the library.
I will create a task for the development team regarding the exception that occurs. Whether the conversion is carried out correctly can be seen after fixing this error.

If you mean the password, then no - since both Acrobat and the library open the document.

@jan.net
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-58322

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Ok, thanks so far.