ZUGFeRD

Hello,

is there any plans to make ZUGFeRD 2.1.1 available for creation? I can create ZUGFeRD 2, but since the version 2 there are changes.

17 Replies 1 reply marked as answer

PN Paul Nekrasov November 4, 2020 10:49 AM UTC

Btw, i get validation error on zf2 from an online validator:

 All properties specified in XMP form shall use either the predefined schemas defined in the XMP Specification, ISO 19005-1 or this part of ISO 19005, or any extension schemas that comply with 6.6.2.3.2.   
 XMPProperty  
 (isPredefinedInXMP2005 == true || isDefinedInMainPackage == true || isDefinedInCurrentPackage == true) && isValueTypeCorrect == true     
     
 root/document[0]/metadata[0](23 0 obj PDMetadata)/XMPPackage[0]/Properties[8](urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0# - fx:Version) 
     
        
 root/document[0]/metadata[0](23 0 obj PDMetadata)/XMPPackage[0]/Properties[7](urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0# - fx:DocumentType)     
        
    
 root/document[0]/metadata[0](23 0 obj PDMetadata)/XMPPackage[0]/Properties[6](urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0# - fx:DocumentFileName)    
        
     
 root/document[0]/metadata[0](23 0 obj PDMetadata)/XMPPackage[0]/Properties[5](urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0# - fx:ConformanceLevel)    
      
  

Seems like metadata isr wrong.


SL Sowmiya Loganathan Syncfusion Team November 5, 2020 01:17 PM UTC

Hi Paul,   
  
Thank you for contacting Syncfusion support.   
  
is there any plans to make ZUGFeRD 2.1.1 available for creation?   
At present we do not have any immediate plans to implement this feature. We usually have an interval of at least three months between releases and at the planning stage for every release cycle, we review all open features. We will consider this feature and update the details once it is implemented. The status of the implementation can be tracked through our Feature Management System,  
  
Btw, i get validation error on zf2 from an online validator:  
  
 All properties specified in XMP form shall use either the predefined schemas defined in the XMP Specification, ISO 19005-1 or this part of ISO 19005, or any extension schemas that comply with 6.6.2.3.2.     
  
We have analyzed the reported issue “ZUGFeRD validation failed while generated ZUGFeRD PDF document” and we did not face any issue related to XMP metadata in Adobe Acrobat preflight. Could you please share us the below details, so that it will helpful for us to provide the precise solution on this.   
  
  • Online validator link
  • Code snippet /Sample
  • Output document
  
  
Regards,  
Sowmiya Loganathan  
  
 



PN Paul Nekrasov November 5, 2020 01:51 PM UTC

Hello Sowmiya,
thank you for your fast answer.

  • Online validator link:
https://www.zugferd-community.net/de/dashboard/validation
  • Code snippet /Sample:
            PdfDocument document = new PdfDocument(PdfConformanceLevel.Pdf_A3B);
            document.ZugferdVersion = ZugferdVersion.ZugferdVersion2_0;
            document.ZugferdConformanceLevel = ZugferdConformanceLevel.Minimum;
            document.Compression = PdfCompressionLevel.Best;

            document.PageSettings.SetMargins(1);

            foreach (PdfTemplate temp in templateList)
            {
                PdfPage page = document.Pages.Add();
                PdfGraphics graphics = page.Graphics;
                graphics.DrawPdfTemplate(temp, PointF.Empty, new SizeF(page.Size.Width, page.Size.Height));
            }
            for (int i = 0; i < annotationList.Count; i++)
            {
                foreach (PdfLoadedAnnotation ant in annotationList[i])
                {
                    document.Pages[i].Annotations.Add(ant);
                }
            }

            using (FileStream invoiceStream = new FileStream(inputXml, FileMode.Open, FileAccess.Read))
            {
                PdfAttachment attachment = new PdfAttachment("zugferd-invoice.xml", invoiceStream)
                {
                    Relationship = PdfAttachmentRelationship.Alternative,

                    ModificationDate = DateTime.Now,

                    Description = "zugferd Rechnung",

                    MimeType = "application/xml"
                };

                document.Attachments.Add(attachment);
                MemoryStream stream = new MemoryStream();
                document.Save(stream);
                using (var fileStream = File.Create(outputPdf))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    stream.CopyTo(fileStream);
                }
            }
            document.Close(true);
  • Output document:
In attatchment. I've generated a pdf without any graphics and dummy values.

Attachment: zf_ab8c0e6f.zip


GK Gowthamraj Kumar Syncfusion Team November 6, 2020 05:04 PM UTC

Hi Paul, 
 
Thank you for your update. 
 
Currently, we are checking this with provided details in our end. We will update you the further details on November 9th 2020. 
 
Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team November 9, 2020 12:30 PM UTC

Hi Paul, 

Thank you for your patience. 
    
We have tried to reproduce the reported issue on our end, but it is working properly. We have created a sample with the provided code snippet and ensured the XMP metadata in Adobe Acrobat preflight and online validator, it passes the compliance. We suspect that the issue occurs only in a particular input document. We were not able to reproduce the issue on our end and we have shared the sample and output document for your reference. Kindly please run the sample on your end and let us know the result.   
  
 
Please refer to this below link for more information, 
 
If still, you are facing the same issue, kindly provide more details such as input XML file, modified sample, and product version to reproduce the issue on our end. So, that it will be helpful for us to analyze and assist you further on this.   

Regards, 
Gowthamraj K 



MS Manuel Schaffner April 13, 2021 01:57 PM UTC

I can confirm the loss of XMP-data:

By adding an existing pdf to an ZUGFeRD-pdf the XMP-data is lost (besides the pdfA3-confomance which can be restored by .ConvertToPDFA(..)):

       public void BuildZugferdPdf(Stream pdfZugferdOutStream, Stream pdfBillA3Stream, Stream xmlZugferdStream)
        {
            var zugferdPdf = new PdfDocument(PdfConformanceLevel.Pdf_A3B)
            {
                ZugferdVersion = ZugferdVersion.ZugferdVersion2_1,
                ZugferdConformanceLevel = ZugferdConformanceLevel.EN16931,
                Compression = PdfCompressionLevel.Best
            };

            var attachment = new PdfAttachment("ZUGFeRD-invoice.xml", xmlZugferdStream)
            {
                Relationship = PdfAttachmentRelationship.Alternative,
                ModificationDate = DateTime.Now,
                Description = "zugferd-invoice",
                MimeType = "application/xml"
            };
            zugferdPdf.Attachments.Add(attachment);

// this looses conformance and XMP-data:
            var pdfBillA3 = new PdfLoadedDocument(pdfBillA3Stream);
            zugferdPdf.ImportPageRange(pdfBillA3, 0, pdfBillA3.Pages.Count - 1);

            var ms = new MemoryStream();  
            zugferdPdf.Save(ms);  
            zugferdPdf.Close();

            var loadedDocument = new PdfLoadedDocument(ms);
            loadedDocument.SubstituteFont += LoadedDocument_SubstituteFont;  
            loadedDocument.ConvertToPDFA(PdfConformanceLevel.Pdf_A3B);  
            loadedDocument.Save(pdfZugferdOutStream);  
            loadedDocument.Close();  
        }



GK Gowthamraj Kumar Syncfusion Team April 14, 2021 03:46 PM UTC

Hi Manuel, 
 
Thank you for contacting Syncfusion support. 
   
We were able to reproduce the conformance issue with provided details on our end. Currently, we are validating on this issue and we will update the further details on April 16th 2021.  
 
Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team April 16, 2021 12:36 PM UTC

Hi Manuel, 
 
Thank you for your patience. 
 
We have confirmed the issue “ZUGFeRD conformance is missing while importing pages from the PDF document” as a defect in our product and we will include the fix for this issue in our weekly NuGet release, which will be available on April 27th, 2021.  
   
Please use the below feedback link to track the status of the reported bug.  
    
Note: If you require patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.  
   
Please let us know if you need any further assistances in this.  
 
Regards, 
Gowthamraj K 



MS Manuel Schaffner April 27, 2021 03:49 PM UTC

Hi Gowthamraj,

XMP data is now available, but pdf-validation fails on https://www.pdf-online.com/osa/validate.aspx for ZUGFeRD-Version 2.0 and 2.1:


            var zugferdPdf = new PdfDocument(PdfConformanceLevel.Pdf_A3B)
            {
               ZugferdVersion = ZugferdVersion.ZugferdVersion2_1,   // ZugferdVersion1_0 passes
               ZugferdConformanceLevel = ZugferdConformanceLevel.Basic,
               Compression = PdfCompressionLevel.Normal
            };
            zugferdPdf.Save(pdfZugferdOutStream);  

Is ths a bug in the lib or in the validator?

Best regards
Manuel

Attachment: Temp_7538fc95.zip


GK Gowthamraj Kumar Syncfusion Team April 28, 2021 04:15 PM UTC

Hi Manuel, 
 
Thank you for your update. 
 
We have confirmed the issue “ZUGFeRD conformance is missing while importing pages from the PDF document” as a defect in our product and we will include the fix for this issue in our weekly NuGet release, which will be available on April 27th, 2021.   
    
Please use the below feedback link to track the status of the reported bug.   
     
Note: If you require patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.   
    
 
We have included the fix for the reported issue “ZUGFeRD conformance is missing while importing pages from the PDF document” in our latest weekly NuGet release (v19.1.0.58). Please use the below link to download our latest weekly NuGet,       
  
XMP data is now available, but pdf-validation fails on https://www.pdf-online.com/osa/validate.aspx for ZUGFeRD-Version 2.0 and 2.1: 


            var zugferdPdf = new PdfDocument(PdfConformanceLevel.Pdf_A3B) 
            { 
               ZugferdVersion = ZugferdVersion.ZugferdVersion2_1,   // ZugferdVersion1_0 passes 
               ZugferdConformanceLevel = ZugferdConformanceLevel.Basic, 
               Compression = PdfCompressionLevel.Normal 
            }; 
            zugferdPdf.Save(pdfZugferdOutStream);   

Is ths a bug in the lib or in the validator? 
 
On further analysis the provided document, we found that the document does not contain any Zugferd xml attachment. We suspect that the issue may occurs due to missing of attachment in the Zugferd Pdf document. Please find the below screenshot, 
 
Kindly please share the more details such as complete code snippet with input documents, simple sample to reproduce the issue on our end. So, that it will be helpful for us to analyze and assist you further on this. 
 
 
Regards, 
Gowthamraj K   



MS Manuel Schaffner April 29, 2021 08:02 AM UTC

Hi Gowthamraj,

This is probabely a problem with the ZUGFeRD-metadata, which seems not to conform with the PDF/A-standard:: 

Version 2.1:

Version 1.0:


The xml-data is not part of this test.


PH Praveenkumar H Syncfusion Team April 30, 2021 03:05 PM UTC

Hi Manuel, 

We are currently validating the reported issue we will let you know further full details on 3 May 2021. 

Regards, 
Praveen 



GK Gowthamraj Kumar Syncfusion Team May 4, 2021 03:38 PM UTC

Hi Manuel, 
 
Thank you for your patience. 

We have tried the PDF/A 3b conformance with mentioned online validator tool using our latest NuGet version. It working properly without any issue. We have attached the sample and converted conformance document for your reference. Kindly please try the below sample on our end and let us know the result.  
 
 
 
 
If still, you are facing an issue, kindly share the complete code or modify the sample. It will help to analyze and provide you a precise solution to this issue.  

Regards, 
Gowthamraj K 



MS Manuel Schaffner May 5, 2021 06:42 AM UTC

Hi Gowthamraj,

I'm using net core 5. I've added my example in your sample solution. Maybe I'm using the wrong nugets?

Regards 
Manuel

Attachment: sample_563417a1.zip


GK Gowthamraj Kumar Syncfusion Team May 6, 2021 02:38 PM UTC

Hi Manuel, 

Thank you for your update. 

We have confirmed that the issue with “ZUGFeRD version 2_1 conformance failed in .Net core.” is a defect and Since you are using a weekly NuGet release version 19.1.0.59. we will include the fix for the reported issue in our upcoming weekly NuGet release once Volume 1  SP1 rolled out which we excepted on mid of May 2021 tentatively. 
 
Note: Date and version will be update later. 
 
Please use the below feedback link to track the status of the reported bug. 
 
Note: If you require patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy. 
 
Regards, 
Gowthamraj K 



MS Manuel Schaffner May 7, 2021 06:37 AM UTC

Thank you!


GK Gowthamraj Kumar Syncfusion Team June 1, 2021 04:17 PM UTC

Hi Manuel, 
 
Thank you for your patience. 
 
We have included the fix for the reported issue “ZUGFeRD version 2_1 conformance failed in .Net core” in our latest weekly NuGet release (v19.1.0.66). Please use the below link to download our latest weekly NuGet,     
  
 
 
Please find the output screenshot from below, 
 
 
Please let us know if you need any further assistance with this. 
 
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon