Products Technologies Demo Docs Blog Support Company

Render Document Pages As Images Using the ReportingCloud REST Web API

The ReportingCloud /v1/templates/thumbnails endpoint renders document pages as PNG, JPG, BMP, or GIF images. Query parameters control zoom factor from 1-400, page range, and output format. Documents from the merge or convert endpoints can be uploaded to generate thumbnails.

Render Document Pages As Images Using the ReportingCloud REST Web API

ReportingCloud is a Web API powered reporting platform to create MS Word compatible reports in the cloud using a REST web service.

The Web API also supports rendering document pages to a variety of image formats such as PNG, JPG, BMP and GIF with the highest available accuracy and quality.

Besides powerful reporting and conversion processes, the API method /v1/templates/thumbnails creates and returns images of document pages. It can be used for templates and resulting documents. If a document has been created using /v1/document/merge or /v1/document/convert, you can upload the document to your template storage in order to create the images using /v1/templates/thumbnails.

The following query parameters are available to specify the zoom factor, the format and to define the page range the images should be created for:

Key Value Type Value Description
templateName String The filename of the template in the template storage.
zoomFactor Integer An Integer value between 1 and 400 to set the percentage zoom factor of the created thumbnail images.
fromPage Integer An Integer value that specifies the first page.
toPage Integer An Integer value that specifies the last page.
imageFormat String A string value that defines the image format of the returned thumbnails. Possible values are PNG, JPG, GIF and BMP.

The following sample code shows how to create images using the ReportingCloud .NET wrapper:

using System;
using System.Collections.Generic;
using System.Drawing;
using TXTextControl.ReportingCloud;

class RCSamples
{
    public static void GetTemplateThumbnails(string templateName)
    {
        ReportingCloud rc = new ReportingCloud(
            "username",
            "password",
            new Uri("https://api.reporting.cloud"));

        try
        {
            List<Image> lstThumbnails = rc.GetTemplateThumbnails(
                templateName, 20, 1, 0, ImageFormat.PNG);

            foreach (Image img in lstThumbnails)
            {
                string sImageFilename = Guid.NewGuid().ToString() + ".jpg";
                img.Save(sImageFilename, System.Drawing.Imaging.ImageFormat.Jpeg);

                Console.WriteLine("Image saved to: " + sImageFilename);
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("An error occurred: " + e.Message);
        }
    }
}

Start today with ReportingCloud and sign up for a free trial account.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Cloud

Are we moving to the cloud? This question is changing from "if" to "when" and "how". Text Control ReportingCloud brings complete reporting functionality to the cloud so all developers can use it, irrespective of the platform or language they're using. Its highly RESTful API can be used to merge Microsoft Word compatible templates with JSON data from all clients including .NET, Javascript, PHP, Node.JS, jQuery, Ruby, Python, Android, Java and iOS.

See Cloud products

Related Posts

CloudReportingReportingCloud

Proofing Tools Available As ReportingCloud Web API Endpoints

ReportingCloud introduces three proofing Web API endpoints for cloud-based spell checking. The proofing/check endpoint detects misspelled words and duplicates, proofing/suggestions returns ranked…


CloudReportingGoogle Fonts

All Google Fonts Now Available in ReportingCloud

ReportingCloud now includes over 2000 Google Fonts on its servers, ensuring consistent rendering across merged documents. The fonts/list endpoint returns all available font names for programmatic…


CloudReportingReportingCloud

New ReportingCloud MergeSettings Option: Merge HTML Content into Merge Fields

ReportingCloud adds a mergeHtml property to MergeSettings that accepts formatted HTML inside merge field data. Supported tags include strong, em, and u wrapped in an html root element. The…


CloudReportingReportingCloud

New ReportingCloud Endpoint: List Available Fonts

ReportingCloud adds a fonts/list API endpoint that returns all font names available for template creation and merge operations. Developers use this to verify that uploaded RTF, DOC, or DOCX…


CloudReportingReportingCloud

What Can You Do with the ReportingCloud RESTful Service?

ReportingCloud merges MS Word templates with JSON data via the /v1/document/merge endpoint, supporting nested master-detail blocks, merge settings, and output as PDF, DOCX, RTF, or HTML.…

Share on this blog post on: