PDF/A-3B not created correctly

MetadataSample.zip (212.4 KB)
Hello Aspose team,

we have a problem with the attached visual studio solution. The goal is to create an empty pdf and attach a file + metadata to it. The resulting pdf should be an PDF/A-3B but this doesn’t seem to work.

Setting the metadata using metadata.xml results in the following:
• The metadata are included
• The pdf is not an PDF/A-3B (tested with Adobe Acrobate Pro DC)

Setting the metadata using metadata_pdfa.xml:
• The metadata are included but the factur-x pdfa extension schema (metadata) has been changed grafik.png (38.9 KB)

• The pdf is an PDF/A-3B

So my question is how can i create an pdf like the one included in the visual studio solution with all the metadata in it + PDF/A-3B conformance (zugferd_EN16931.pdf)

@docuguide

Following simple code snippet is able to generate the valid compliant PDF document:

Document doc = new Document();
doc.Pages.Add();
fileName = "Document.xml";
FileSpecification fs = new FileSpecification(fileName);
doc.EmbeddedFiles.Add(fs);
fs.Description = "Zugferd";
fs.MIMEType = "text/xml";
fs.SetValue("AFRelationship", "Alternative");
doc.Save("38578.pdf");

zugferd-invoice.zip (4.7 KB)
38578.pdf (11.2 KB)

ZUGFeRD was added as one of support formats. Convert method should be called in order to make document ZUGFeRD compatible (similar to PDF/A conversion).

Document doc = new Document();
doc.Pages.Add();
string fileName = "zugferd-invoice.xml";
FileSpecification fs = new FileSpecification(fileName);
doc.EmbeddedFiles.Add(fs);
fs.Description = "Zugferd";
doc.Convert(new MemoryStream(), PdfFormat.ZUGFeRD, ConvertErrorAction.Delete);
doc.Save("invoice.pdf");

We have further logged an investigation ticket as PDFNET-49370 in our issue tracking system for your particular case. We will further look into its details and share our feedback with you as soon as the ticket is resolved. Please be patient and spare us some time.

1 Like

@asad.ali That was exactly what we needed. Thanks a lot :grinning:

Hi I have the same issue and look for it
and I can’t add the meta data
doc.Metadata.RegisterNamespaceUri(“fx”, “urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#”,“Factur-X schema”);
doc.Metadata[“fx:DocumentType”] = “INVOICE”;
doc.Metadata[“fx:DocumentFileName”] = “factur-x.xml”;
doc.Metadata[“fx:Version”] = “1.0”;
doc.Metadata[“fx:ConformanceLevel”] = “BASIC”;

No exception are raised but the XMP xml is invalid.
We really need it thanks :slight_smile:

@Phildem

Could you please share your sample source PDF document with us? Also please share how you are validating if XMP XML is invalid? We will test the scenario in our environment and address it accordingly.