예제 #1
0
        public void CreateWord(WordprocessingDocument package, Report template, object obj = null)
        {
            MainDocumentPart mainDocumentPart = package.AddMainDocumentPart();

            DocumentFormat.OpenXml.Wordprocessing.Document document = new DocumentFormat.OpenXml.Wordprocessing.Document();
            ImagePart image = mainDocumentPart.AddImagePart(ImagePartType.Jpeg);

            using (FileStream file = new FileStream(template.Main.Barcode.PathBarcode, FileMode.Open))
            {
                image.FeedData(file);
            }
            PageSetting   settingpage    = new PageSetting();
            DocumentsFull documentInvoce = new DocumentsFull();

            document.Append(settingpage.ParametrPageHorizont());
            document.Append(documentInvoce.DocumentsBook(template, mainDocumentPart.GetIdOfPart(image)));
            mainDocumentPart.Document = document;
        }