Created
March 21, 2019 05:37
-
-
Save GroupDocsGists/e7f1b9dcbe46acf1bf8754278ada7de0 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
// For complete examples and data files, please go to https://github.com/groupdocs-merger/GroupDocs.Merger-for-.NET | |
string sourceFile = CommonUtilities.sourcePath + fileName; | |
// Preparing. | |
string password = "SomePasswordString"; | |
int startPage = 5; | |
int endPage = 8; | |
RangeMode mode = RangeMode.EvenPages; | |
SplitOptions splitOptions = new SplitOptions(FileFormat.Vsdx, password,startPage, endPage, mode); | |
Stream openFile = new FileStream(sourceFile, FileMode.Open); | |
// Main method. | |
MultiDocumentResult splitResult = new DocumentHandler().Split(openFile, splitOptions); | |
for (int i = 0; i < splitResult.Documents.Count; i++) | |
{ | |
Stream documentStream = splitResult.Documents[i].Stream; | |
//output file | |
var fileStream = File.Create(CommonUtilities.outputPath + "OutPut " + i + "." + FileFormat.Vsdx); | |
documentStream.CopyTo(fileStream); | |
documentStream.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment