Created
March 21, 2019 05:34
-
-
Save GroupDocsGists/9a16a7e5ba191c2169f2287bc5cee091 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; | |
//Set password, as document is password protected | |
string password = "somepassword"; | |
List<int> pages = new List<int>(); | |
pages.Add(2); | |
RemovePagesOptions pagesOptions = new RemovePagesOptions(FileFormat.Vsdx, password, pages); | |
Stream openFile = new FileStream(sourceFile, FileMode.Open); | |
DocumentResult result = new DocumentHandler().RemovePages(openFile, pagesOptions); | |
Stream documentStream = result.Stream; | |
//output file | |
var fileStream = File.Create(CommonUtilities.outputPath + "OutPut." + 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