public PersonFiles[] SplitWord(string docName, byte[] docxFile, byte[] xmlFile) { ISplit run = new WordSplit(docName); MemoryStream doc = new MemoryStream(docxFile); MemoryStream xml = new MemoryStream(xmlFile); run.OpenAndSearchDocument(doc, xml); return(run.SaveSplitDocument(doc).ToArray()); }
public void Init() { var wordSplit = new WordSplit("demo"); WordSampleMerge = wordSplit; WordSampleSplit = wordSplit; SplitXml = wordSplit; DocValidator = new OpenXmlValidator(); var parts = PartsSelectionTreeElementMock.GetListMock(); CreateSplitXmlBinary = SplitXml.CreateSplitXml(parts); WordSampleDocInMemory = new MemoryStream(File.ReadAllBytes(@"../../../Files/demo.docx")); byte[] sampleXmlBinary = File.ReadAllBytes(@"../../../Files/split_demo.docx_20170227215840894.xml"); wordSplit.OpenAndSearchDocument(WordSampleDocInMemory, new MemoryStream(sampleXmlBinary)); MergeXmlBinary = WordSampleMerge.CreateMergeXml(); ErrorsCount = 0; WarningsCount = 0; }