Generate PDFa-3a - the key type is required but missing

Hi
My Customer wants a PDF/A-3a Document.

If he checks the pdf he get an error:
"
the key type is required but missing.
the document doesent provide appropriate structure information.
the document is not conform the PDF/a-3a standard.
"

I user the AsposePdfFormat.PDF_A_3A Format.
How can I set the “key type”?

@FredCleverli22

Would you kindly share the sample code snippet being tried to convert PDF to PDF/A-3a. Also, please share a sample source PDF document with us. We will test the scenario in our environment and address it accordingly.

Hi.
The code uses your .dll. The source code is in Microsoft NAV an ERP System.

Rechnung_103035-Zugpferd_V2.1.1.pdf (64.2 KB)

//Load License
AsposeSetLicense(AsposePDFLicense);
AsposePDFDocument := AsposePDFDocument.Document(pFilePath + pFileName);

//Create Temp Conversion Log File
TempResultFile := FileManagement.ServerTempFileName('xml');

//Set PDF/A Standard
AsposePdfFormat := AsposePdfFormat.PDF_A_3A;

//Add additional files? Depending on PDF/A version!!    
{  Comment optionally:
AsposeFileSpecification := AsposeFileSpecification.FileSpecification('C:\_\Rechnung_103035.xml');   
AsposePDFDocument.EmbeddedFiles.Add(AsposeFileSpecification);
}

//Convert PDF
AsposePDFDocument.Convert(TempResultFile, AsposePdfFormat, AsposeConvertErrorAction.Delete);

//Read XML Conversion Result Log
ResultFile.OPEN(TempResultFile);
ResultFile.CREATEINSTREAM(InStream);
ReadPDFAConversionResult(InStream);

//Save PDF/A
AsposePDFDocument.Save(pFilePath + pFileName);

@FredCleverli22

We tested the scenario with Aspose.PDF for .NET 20.10 and were unable to notice the Exception that you have mentioned. Would you kindly try to use the latest version of the API and in case you face any issue, please let us know. Attached is the generated output for your kind reference.

output2010.pdf (64.2 KB)

Hi.

I use the net4.0 components (Date 4.12.2019).

  1. I have a output form my ERP-System: Rechnung_103035
  2. I generated the file Rechnung_103035.xml
  3. Now I want to make a PDF_A_3A Format. with the attached XML.

In a PDF Viiewer I can see the xml. But another SOftware which gets my PDF say that the XML can not extracted.

.

Rechnung_103035-Zugpferd_V2.1.1.pdf (66.6 KB)
Rechnung_103035.pdf (61.3 KB)
Rechnung_103035.zip (123.4 KB)

@FredCleverli22

As per our understandings, you need to create a PDF_A_3A document with an attachment of XML file. You are able to do it and Adobe Reader shows it as well. But there is some other software which is unable to load the attachment from generated PDF/A document.

Please let us know if our understandings are incorrect. Also, please let us know about the other software which you are using to view the PDF files. We will further proceed to assist you accordingly.

Yes ist is correct: PDF_A_3A document with an attachment of XML file

I use the PDF Viewer: Foxit. The Viewer has no problem to show the included XML.

But:
I generate the PDF to use it für X Invoice (Zugpferd): I send an invoice to a Customer in optical form (PDF) and xml Form.

There exists software to check the PDF_A_3A document with an attachment of XML file

Example:

This Validaten tools throw an error:

"
Es konnte kein ZUGFeRD XML aus dem PDF extrahiert werden.
warning - No valid ZUGFeRD file.

[PDF/A Prüfbericht]
Konformitätsstufe: PDF/A-3a
Warnungen: 1

[Dokument-Informationen]
Dateiname: 20201020_0804_fjuWzO.pdf
Version: PDF-1.7/1.7
Seiten: 1
Titel: n.a.
Autor: n.a.
Betreff: n.a.
Schlüsselwörter: n.a.
Erstellt: 14.10.2020, 17:32:12
Modifiziert: 14.10.2020, 17:32:13
Ersteller: Aspose Ltd.
Produzent: Aspose.PDF for .NET 19.12

[Warnungen]
1 Parameter fehlen
"

@FredCleverli22

Thanks for explaining the issue further.

We have logged an investigation ticket as PDFNET-48915 in our issue tracking system for the sake of further analysis. We will look into its details and keep you informed about its rectification status. Please be patient and spare us some time.

We are sorry for the inconvenience.