Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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
You can’t perform that action at this time.