Rendering Document to Responsive HTML

Note
Note: The features listed in this page are supported only in GroupDocs.Viewer Cloud V1

GroupDocs.Viewer supports to render a document to responsive HTML. It provides a EnableResponsiveRendering property, that lets you get responsive output HTML. The following example demonstrates how to minify output content when creating cache.

NOTE: This feature is supported by all methods which accepts objects.

Please note, that currently this option works for most document types, but there are few (listed below) that are not supported yet. We are planning to extend support for this option in coming releases.

List of document types that do not support responsive rendering.

Format NameExtension
Portable Document FormatPDF
Microsoft ExcelXLS, XLSX, XLSM, XLSB
Microsoft PowerPointPPT, PPTX, PPS, PPSX
Microsoft ProjectMPP, MPT
OpenDocument FormatsODS, ODP, OTP, OTS
Plain Text FileTXT
Comma-Separated ValuesCSV
HyperText Markup LanguageHTML, MHT, MHTML
Extensible Markup LanguageXML
XML Paper SpecificationXPS
Electronic publicationEPUB
Mobipocket e-book formatMOBI
LaTeXTEX

The following GroupDocs.Viewer Cloud REST API resource has been used to get document page as responsive HTML.

cURL example

curl -v "http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/1?embedResources#true&enableResponsiveRendering#true" \
-X GET \
-H "Content-Type: application/json" \
-H "authorization: Bearer xxxxxxxxxxx"
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;" charset="utf-8" />
    <title></title>

    <link rel="stylesheet" type="text/css"
    href="http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/1/resources/styles.css" media="all" />

    <link rel="stylesheet" type="text/css"
    href="http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/1/resources/styles.css" media="all" />
</head>

<body>
    <div class="p1-uaUyVgCv-div p1-uaUyVgCv-page" style="width:612pt;height:792pt;" >
        <div class="p1-uaUyVgCv-div" style="left:72pt; top:72pt; z-index:1;" >
            <span class="p1-uaUyVgCv-span p1-uaUyVgCv-text1" style="font-size:11pt; left:0pt; top:0pt;" >This is test</span>
        </div>
        <div class="p1-uaUyVgCv-div" style="z-index:1;" >
            <img class="p1-uaUyVgCv-img" style="left:512pt; top:346pt; width:100pt; height:100pt;" src="http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/1/resources/image.png" />
        </div>
    </div>
</body>
</html>

SDK examples

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.