Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Aspose.Pdf for ZUGFeRD attachments

$
0
0
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:

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"))

Viewing all articles
Browse latest Browse all 3131

Trending Articles