Rendering Custom Pages to HTML
GroupDocs.Viewer also provides the features to render only the selected pages. You can specify a list of the document pages to be rendered. Follow the below steps to achieve this functionality.
- Create and populate the object of ViewerConfig
- Instantiate the object of ViewerHtmlHandler by passing the ViewerConfig object into its constructor
- Instantiate the HtmlOptions object. The password must be set here if the document is password protected
- Set/Pass a list of page numbers to PageNumbersToRender of HtmlOptions class
- Call GetPages method
The following code sample shows how to render specific pages of a document.