byte[] doc_bytes_invoice_added = null; string input = @"C':\test\"; using (PDFDoc in_doc = new PDFDoc(input + "output.pdf")) { in_doc.InitSecurityHandler(); NameTree files = NameTree.Create(in_doc, "EmbeddedFiles"); FileSpec fs = FileSpec.Create(in_doc, input + "ZUGFeRD-invoice.xml", true); byte[] file1_name = System.Text.Encoding.UTF8.GetBytes("ZUGFeRD-invoice.xml"); files.Put(file1_name, fs.GetSDFObj()); fs.GetSDFObj().PutText("Desc", "ZUGFeRD Rechnung"); fs.GetSDFObj().PutName("AFRelationship", "Alternative"); fs.GetSDFObj().PutText("F", "ZUGFeRD-invoice.xml"); fs.GetSDFObj().PutText("UF", "ZUGFeRD-invoice.xml"); Obj collection = in_doc.GetRoot().FindObj("Collection"); if (collection == null) collection = in_doc.GetRoot().PutDict("Collection"); collection.PutName("View", "T"); doc_bytes_invoice_added = in_doc.Save(SDFDoc.SaveOptions.e_incremental); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)