void BillingEngine_EinvNodeAdding(object sender, MercatorUi.Engine.Gescom.BillingEngine.EinvNodeAddingEventArgs e)
{
MercatorUi.Engine.Gescom.BillingEngine billingEngine = (MercatorUi.Engine.Gescom.BillingEngine)sender;
if (e.Node.Name == "cac:AccountingSupplierParty")
{
string file = @"C:\Test.pdf";
XmlNode n1 = billingEngine.EinvAddNode(e.eInvoiceEnum, e.ParentNode, "cac:AdditionalDocumentReference");
billingEngine.EinvAddNode(e.eInvoiceEnum, n1, "cbc:ID", Api.JustFName(file));
billingEngine.EinvAddNode(e.eInvoiceEnum, n1, "cbc:DocumentType", "Appendix");
XmlNode n2 = billingEngine.EinvAddNode(e.eInvoiceEnum, n1, "cac:Attachment");
billingEngine.EinvAddNode(e.eInvoiceEnum, n2, "cbc:EmbeddedDocumentBinaryObject", Convert.ToBase64String(System.IO.File.ReadAllBytes(file)), new MercatorUi.Engine.Gescom.Tools.EinvNodeAttribute("mimeCode", "application/pdf"), new MercatorUi.Engine.Gescom.Tools.EinvNodeAttribute("filename", Api.JustFName(file)));
}
}