Created
October 3, 2019 09:01
-
-
Save GroupDocsGists/0bd8b4db277c1db0f9f3590e819a4c32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string sourceFile1 = CommonUtilities.fileOne + fileOne; | |
string sourceFile2 = CommonUtilities.fileTwo + fileTwo; | |
// Preparing. | |
string password = "SomePasswordString"; | |
Stream openFile1 = new FileStream(sourceFile1, FileMode.Open); | |
Stream openFile2 = new FileStream(sourceFile2, FileMode.Open); | |
List<JoinItem> documentStreams = new List<JoinItem>(); | |
JoinItem item1 = new JoinItem(openFile1, FileFormat.Docx, password); | |
documentStreams.Add(item1); | |
JoinItem item2 = new JoinItem(openFile2, FileFormat.Docx, password); | |
documentStreams.Add(item2); | |
// Main method. | |
DocumentResult result = new DocumentHandler().Join(documentStreams); | |
Stream documentStream = result.Stream; | |
var fileStream = File.Create(CommonUtilities.outputPath + "OutPut." + FileFormat.Docx); | |
documentStream.CopyTo(fileStream); | |
documentStream.Close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment