Aspose.Pdf for ZUGFeRD attachments

Hello,

I am evaluating Aspose.Pdf to see if it can be used to generate ZUGFeRD-compatible PDFs.

ZUGFeRD is a German standard for electronic invoices. Basically you attach an XML file (representing an invoice) to a PDF and add various metadata.

My questions are:

1) According to the ZUGFeRD standard, the mime type of the attachment must be set to “text/xml”. There is a MIMEType field on the FileSpecification class, but whenever I try to set it I get a NullReferenceException. I am us the latest evaluation version of Aspose.Pdf.

Document doc = new Document(“in.pdf”);
Stream fs = File.OpenRead(“zugferd-invoice.xml”);
FileSpecification spec = new FileSpecification(fs, “ZUGFeRD invoice in XML format”);
spec.Description = “ZUGFeRD invoice in XML format”;
spec.Name = “ZUGFeRD-invoice.xml”;
spec.Contents = fs;
spec.MIMEType = “text/xml”; // NullReferenceException here
doc.Save(“out.pdf”);

Is it possible to set the mime type with Aspose.Pdf or is this not supported?

2) It is also necessary to specify the relationship between the attached file and the PDF part in the “document dictionary”. Does Aspose.Pdf have support for this? I might be using the wrong terms here since I’m not so well-acquainted with the PDF standard, but if you look at this link:

vb.net - iTextSharp XML ZUGFeRD-invoice.xml attachment - Stack Overflow

What I want to know if Aspose.Pdf has some equivalent for this line:

fileSpec.Put(New PdfName(“AFRelationship”), New PdfName(“Alternative”))

andreas.jonsson:
I am evaluating Aspose.Pdf to see if it can be used to generate ZUGFeRD-compatible PDFs.

ZUGFeRD is a German standard for electronic invoices. Basically you attach an XML file (representing an invoice) to a PDF and add various metadata.

My questions are:

1) According to the ZUGFeRD standard, the mime type of the attachment must be set to “text/xml”. There is a MIMEType field on the FileSpecification class, but whenever I try to set it I get a NullReferenceException. I am us the latest evaluation version of Aspose.Pdf.

Document doc = new Document(“in.pdf”);
Stream fs = File.OpenRead(“zugferd-invoice.xml”);
FileSpecification spec = new FileSpecification(fs, “ZUGFeRD invoice in XML format”);
spec.Description = “ZUGFeRD invoice in XML format”;
spec.Name = “ZUGFeRD-invoice.xml”;
spec.Contents = fs;
spec.MIMEType = “text/xml”; // NullReferenceException here
doc.Save(“out.pdf”);

Is it possible to set the mime type with Aspose.Pdf or is this not supported?
Hi Andreas,

Thanks for your interest in our API’s.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38577. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>

We apologize for your inconvenience.


andreas.jonsson:
2) It is also necessary to specify the relationship between the attached file and the PDF part in the "document dictionary". Does Aspose.Pdf have support for this? I might be using the wrong terms here since I'm not so well-acquainted with the PDF standard, but if you look at this link:

http://stackoverflow.com/questions/26036852/itextsharp-xml-zugferd-invoice-xml-attachment

What I want to know if Aspose.Pdf has some equivalent for this line:

fileSpec.Put(New PdfName("AFRelationship"), New PdfName("Alternative"))
I have an investigation ticket to support the creation of ZUGFeRD attachments as PDFNEWNET-38578. We will further look into the details of this requirement and will keep you posted with our findings.

Hi,

has there been any progress on these tickets?

I’ve also been trying to create a ZUGFeRD-compliant PDF and ran into exactly the same problems as Andreas - after which some googling led me here.

Is there any chance this is going to work in the near future?

Hi Steffen,


Thanks for your inquiry. I am afraid the subjected feature is still not implemented as product team is busy in fixing/implementing other issues, reported earlier. However, we have recorded your concern and will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hi,
7 more months gone and still no ZUGFeRD-Support? (Aspose.PDF 11.4.0). I’m evaluating Aspose.PDF but may have to DIspose it, if there is no solution in the near future :wink:

Hi Harald,


Thanks for your inquriy. I am afraid product team is busy in resolving other issues in the queue. However we have raised the issues’ priority and requested our product team to share the ETA/findings at their earliest. We will update you as soon as we get a feedback.

Thanks for your patience and cooperation.

Best Regards,

I’ve to second this request, this requirement becomes more important in future, so at least some informations about the priorization / roadmap of this issue should be given.

Hi Christian,


Thanks for your interest in Aspose. We have recorded your request for the subjected feature. As soon as our product team completes the investigation then we will share the ETA/findings with you accordingly.

Best Regards,

Hello,

as this topic is serious business in Germany and a requirement for digital invoices in some industry sectors, i attached some official samples of zugferd-documents for review.

The thread was opened one year ago and still it is not even possible to set some simple properties at the embedded file (like the stream mime - it’s only a getter that returns null when adding a xml-stream).



Hi Christian,


Thanks for sharing your concern. I am afraid the subjected feature is still pending for review as the team is busy in fixing/implementing other high priority issues reported earlier. The team will surely start investigating and implementing the feature as per their development plans but as normal rule of practice, the issues are resolved in first come first serve basis. We will notify you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

I’d like to share some things i found out so far:

it is possible to set the mimetype of the included xml, but you have to add the filespec to the doc before doing so.

A.Document doc = new A.Document(@"D:\temp\in.pdf");

doc.Convert(@"D:\Temp\pdfconvert.xml", A.PdfFormat.PDF_A_3A, A.ConvertErrorAction.None);

FileStream fs = File.OpenRead(xmlpath);
A.FileSpecification spec = new A.FileSpecification(fs, "ZUGFeRD invoice in XML format");
spec.Name = "ZUGFeRD-invoice.xml";
spec.Description = "ZUGFeRD Rechnung";
doc.EmbeddedFiles.Add(spec);

spec.MIMEType = "text/xml";
spec.Params = new A.FileParams(spec) {
    ModDate = info.LastWriteTime,
    CreationDate = info.CreationTime
};

also it is possible to add the xmp extension schema.



Missing things are:

  • /Type: /EmbeddedFile (at the Stream)
  • /AFRelationship: /Alternative (at the FileSpecification)
  • FileSpecification.Params.Size is not calculated

Hi Christian,


Thanks for sharing your findings. We have shared the details with the team. We keep you updated about the issue resolution progress.

Thanks for your patience and cooperation.

Best Regards,
Hi Tilal

i would also like to draw attention to this issue. We also need to create invoice pdf documents that supports the ZUGFeRD specifications. This type of invoice document will become more and more important in Europe.

@Christian Thanks for the workaround.

Best regards
Matthias

Hi Matthias,


Thanks for your interest. We have recorded your concern. Our product team is working over the feature, as soon as it is implemented in Apsose.Pdf for .NET then we will make it available in Aspose.Pdf for Java as well. We have also created a task PDFJAVA-36434 for the purpose. We will notify you as soon as some update is available.

Thanks for your patience and cooperation.

Best Regards,
Hi Tilal,

as i said before, we also need to create invoice pdf documents that supports the ZUGFeRD specifications right now.
Is there any chance this is going to work in the near future? Or is there any way to for us to speed up the processing of this missing feature?

Best regards
Matthias

Hi Matthias,


Thanks for your inquiry. Our product team is working over the feature. Your concern has been recorded in the ticket. I have also asked the product team to share some ETA for this feature. As soon as I get some definite update from the product team I will share it with you.

We are sorry for the inconvenience.

Best Regards,

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px ‘Helvetica Neue’; -webkit-text-stroke: #000000}
span.s1 {font-kerning: none}
span.s2 {text-decoration: underline ; font-kerning: none; color: #9e4b2f; -webkit-text-stroke: 0px #9e4b2f}

Hey Fahadadeel,

Any update on this or an ETA on the implementation?

@bailcm,

There is no update regarding the support of ZUGFeRD attachments. Our product team will investigate as per their development schedules. We will let you know once a significant progress has been made in this regard.

Hello,
I am facing the same Problem. we want to switch to Aspose PDF and We have to create PDF-Files for the ZUGFeRD-Format. In the meantime other countries in Europe want to use this too.
the sample Code of Andreas has still the same Problem at Setting the mimetype. Do you have experience in creating ZUGFeRD compliant PDF-files ?
Regards
Jörg

@de14jne

Thanks for your inquiry.

I am afraid that earlier logged ticket regarding ZUGFeRD-Format support is still pending due to other high priority issues in the queue. However, would you please share some more details about this format specifications. It would help us investigating the feasibility of feature and provide our feedback accordingly.