Created
March 21, 2019 05:38
-
-
Save GroupDocsGists/e16475c2d74c0d5f2aa3a3ea85b6833a 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; | |
// Preparation. | |
string password = "SomePasswordString"; | |
int pageNumber1 = 3; | |
int pageNumber2 = 6; | |
List<int> pages = new List<int>(); | |
pages.Add(pageNumber1); | |
pages.Add(pageNumber2); | |
TrimOptions trimOptions = new TrimOptions(FileFormat.Vsdx, password, pages); | |
Stream openFile = new FileStream(sourceFile, FileMode.Open); | |
// Main method. | |
DocumentResult result = new DocumentHandler().Trim(openFile, trimOptions); | |
Stream documentStream = result.Stream; | |
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