Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created October 19, 2017 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/4b64222705358160a139ae656d89de9a to your computer and use it in GitHub Desktop.
Save GroupDocsGists/4b64222705358160a139ae656d89de9a to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
//Get Configurations
ViewerConfig config = Utilities.GetConfigurations();
// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
// Guid implies that unique document name
string guid = DocumentName;
// Set Cad options to render content with a specified size
ImageOptions options = new ImageOptions();
options.CadOptions.Height = 750;
options.CadOptions.Width = 450;
//Get document pages in image form
List<PageImage> Images = imageHandler.GetPages(guid, options);
foreach (PageImage image in Images)
{
//Save each image at disk
Utilities.SaveAsImage(image.PageNumber + "_" + DocumentName, image.Stream);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment