Render with responsive layout

Responsive design aims to make web pages render well on a variety of devices. GroupDocs.Viewer provides the setRenderResponsive() method 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:

import com.groupdocs.viewer.Viewer;
import com.groupdocs.viewer.options.HtmlViewOptions;
// ...

try (Viewer viewer = new Viewer("sample.docx")) {
    HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
    // Render with responsive layout.
    viewOptions.setRenderResponsive(true);
    viewer.view(viewOptions);
}