The /document/thumbs Robot

We can process your documents in an automated way, saving you costly resources.

The /document/thumbs Robot generates an image for each page in a PDF file or an animated gif file that loops through all pages.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
page Integer / Null null The PDF's page that you want to convert to an image. By default the value is null which means that all pages will be converted into images.
format String "png" The format of the extracted image(s). Supported values are "jpeg", "jpg", "gif" and "png". If you specify the value "gif" then an animated gif cycling through all pages is created. Please check out this demo to learn more about this.
delay Integer / Null null If your output format is "gif" then this parameter sets the number of 100th seconds to pass before the next frame is shown in the animation. Set this to 100 for example to allow 1 second to pass between the frames of the animated gif. If your output format is not "gif", then this parameter does not have any effect.
width Integer(1-5000) Auto Width of the new image, in pixels. If not specified, will default to the width of the input image
height Integer(1-5000) Auto Height of the new image, in pixels. If not specified, will default to the height of the input image
resize_strategy String "pad" One of the available resize strategies.
background String "#FFFFFF" Either the hexadecimal code or name of the color used to fill the background (only used for the pad resize strategy). Note by default, the background of transparent images is changed to white. For details about how to preserve transparency across all image types, see this demo.
density String / Null null While in-memory quality and file format depth specifies the color resolution, the density of an image is the spatial (space) resolution of the image. That is the density (in pixels per inch) of an image and defines how far apart (or how big) the individual pixels are. It defines the size of the image in real world terms when displayed on devices or printed. You can set this value to a specific width or in the format widthxheight. If your converted image has a low resolution, please try using the density parameter to resolve that.
trim_whitespace Boolean true This determines if additional whitespace around the PDF should first be trimmed away before it is converted to an image. If you set this to true only the real PDF page contents will be shown in the image. If you need to reflect the PDF's dimensions in your image, it is generally a good idea to set this to false.
pdf_use_cropbox Boolean true Some PDF documents lie about their dimensions. For instance they'll say they are landscape, but when opened in decent Desktop readers, it's really in portrait mode. This can happen if the document has a cropbox defined. When this option is enabled (by default), the cropbox is leading in determining the dimensions of the resulting thumbnails.

Demos

Our /document/thumbs Robot can be used in combination with other Robots, to create powerful workflows unique to your use case. Here are a few example scenarios that you can try live on our website:

Blog posts about the /document/thumbs Robot

We wrote the following posts about the /document/thumbs Robot on our blog:

Did you know?

You can easily combine Robots to create powerful workflows, unique to your business.
This is the power of Transloadit.