Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created December 28, 2023 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/baa2897f3a2012f55e0ddddd64d15eb5 to your computer and use it in GitHub Desktop.
Save bjoerntx/baa2897f3a2012f55e0ddddd64d15eb5 to your computer and use it in GitHub Desktop.
string xmlZugferd = xRechnung.CreateXML();
// load Xml file
string metaData = File.ReadAllText("metadata.xml");
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings();
// create a new embedded file
var zugferdInvoice = new TXTextControl.EmbeddedFile(
"ZUGFeRD-invoice.xml",
Encoding.UTF8.GetBytes(xmlZugferd),
metaData);
zugferdInvoice.Description = "ZUGFeRD-invoice";
zugferdInvoice.Relationship = "Alternative";
zugferdInvoice.MIMEType = "application/xml";
zugferdInvoice.LastModificationDate = DateTime.Now;
// set the embedded files
saveSettings.EmbeddedFiles = new TXTextControl.EmbeddedFile[] { zugferdInvoice };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment