Call the View method. Specify the page numbers as the last parameters.
The following code snippet shows how to render the first and third pages of a document:
using(Viewerviewer=newViewer("sample.docx")){// Create an HTML file.HtmlViewOptionsviewOptions=HtmlViewOptions.ForEmbeddedResources();// Specify the page numbers.viewer.View(viewOptions,1,3);}
Specify pages by using an array
To specify pages by using an array, follow these steps:
Call the View method. Specify the page numbers array as the second parameter.
The following code snippet shows how to render the 1st, 2nd, and 4th pages of a document:
// Create an array and specify page numbers.int[]pageNumbers=newint[]{1,2,4};using(Viewerviewer=newViewer("sample.docx")){// Create an HTML file.varviewOptions=HtmlViewOptions.ForEmbeddedResources();// Use array to render specific pages.viewer.View(viewOptions,pageNumbers);}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.