Rendering Document to Responsive HTML
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 Name | Extension |
---|---|
Portable Document Format | |
Microsoft Excel | XLS, XLSX, XLSM, XLSB |
Microsoft PowerPoint | PPT, PPTX, PPS, PPSX |
Microsoft Project | MPP, MPT |
OpenDocument Formats | ODS, ODP, OTP, OTS |
Plain Text File | TXT |
Comma-Separated Values | CSV |
HyperText Markup Language | HTML, MHT, MHTML |
Extensible Markup Language | XML |
XML Paper Specification | XPS |
Electronic publication | EPUB |
Mobipocket e-book format | MOBI |
LaTeX | TEX |
Resource
The following GroupDocs.Viewer Cloud REST API resource has been used to get document page as responsive HTML.
cURL REST 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>
SDKs
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.