Render with responsive layout

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:

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
// ...

using (Viewer viewer = new Viewer("sample.docx"))
{
    // Create view options.
    var viewOptions = HtmlViewOptions.ForEmbeddedResources();
    
    // Render the file with responsive layout.
    viewOptions.RenderResponsive = true;
    viewer.View(viewOptions);
}
Imports GroupDocs.Viewer
Imports GroupDocs.Viewer.Options
' ...

Module Program
    Sub Main(args As String())
        Using viewer As Viewer = New Viewer("sample.docx")
            ' Create view options.
            Dim viewOptions = HtmlViewOptions.ForEmbeddedResources()
        
            ' Render the file with responsive layout.
            viewOptions.RenderResponsive = True
            viewer.View(viewOptions)
        End Using
    End Sub
End Module