Responsive design aims to make web pages render well on a variety of devices. GroupDocs.Viewer provides the RenderResponsive property of the HtmlViewOptions class to render HTML pages with responsive layout.
The following code snippet shows how to render a .docx document to HTML with responsive layout:
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...using(Viewerviewer=newViewer("sample.docx")){// Create view options.varviewOptions=HtmlViewOptions.ForEmbeddedResources();// Render the file with responsive layout.viewOptions.RenderResponsive=true;viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())UsingviewerAsViewer=NewViewer("sample.docx")' Create view options.
DimviewOptions=HtmlViewOptions.ForEmbeddedResources()' Render the file with responsive layout.
viewOptions.RenderResponsive=Trueviewer.View(viewOptions)EndUsingEndSubEndModule
sample.docx is the sample file used in this example. Click here to download it.