Products Technologies Demo Docs Blog Support Company

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…

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

We just rolled out 3 new ReportingCloud endpoints to integrate spell checking functionality to your cloud-based applications in more than fifty languages.


CloudReportingGoogle Fonts

All Google Fonts Now Available in ReportingCloud

Making the web more beautiful, fast, and open through great typography. This is the motto of Google Fonts. The advantage of ReportingCloud is a consistent rendering of documents.


CloudReportingReportingCloud

New ReportingCloud MergeSettings Option: Merge HTML Content into Merge Fields

One of the most requested features for ReportingCloud is a way to merge formatted content into merge fields. We have added this feature to the API and rolled it out last weekend. The MergeSettings…


CloudReportingReportingCloud

New ReportingCloud Endpoint: List Available Fonts

We just rolled out a new Web API endpoint which returns available font names that can be used to create and merge templates for merge processes with ReportingCloud.…


CloudReportingReportingCloud

What Can You Do with the ReportingCloud RESTful Service?

The RESTful web service Text Control ReportingCloud is a Web API powered reporting platform that provides the mail merge and reporting functionality of the powerful .NET component TX Text Control.…