Minification of HTML and SVG

Since the version 18.2 GroupDocs.Viewer API, we have provide a new EnableMinification property, that lets you get output content minified. Minification removes comments, extra white-spaces, and other unneeded characters without breaking the content structure. As a result page become smaller in size and loads faster. The following example demonstrates how to minify output content when creating cache.

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

Resource

The following GroupDocs.Viewer Cloud REST API resource has been used to create document cache as HTML.

cURL REST Example

curl -v "https://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages" \
-X POST \
-H "Content-Type: application/json" \
-d "{{enableMinification: true}}" \
-H "authorization: Bearer xxxxxxxxxxx"
{
  "fileName": "one-page.docx",
  "folder": null,
  "pages": [
    {
      "number": 1,
      "resources": [
        {
          "name": "font.woff",
          "url": "http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/
1/resources/font.woff"
        },
        {
          "name": "image.png",
          "url": "http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/
1/resources/image.png"
        },
        {
          "name": "styles.css",
          "url": "http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/
1/resources/styles.css"
        }
      ],
      "url": "http://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pages/1"
    }
  ]
}

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.

Create Document Pages Cache as Minified HTML