1. PDF Tools
  2. Convert PDF to PNG Images

PDF Tools

Convert PDF to PNG Images

Converts each page of a PDF into a color PNG image. Useful for page previews, thumbnails, and sending document pages to image-based tools.

Uses

Use this task for turning a PDF into images, for example to show a preview of each page or to pass the pages to an AI agent that reads images.

Basic Usage

loading...

Parameters Explained

files
required
array

An array of PDF files to convert to images.

dpi
optional
number

The resolution of the images in dots per inch. Defaults to 300. A higher value gives sharper images but larger files, and the task takes longer to run. Must be a whole number greater than 0.

function
required
string

The pdf_tools function to call, in this case it would be pdf_to_png

Result

Every page of each PDF becomes its own color PNG image. A PDF with three pages returns three images.

The newly created files are returned in files. The same files are returned in attachments, which adds them to the stub's attachments.

editor
        {
  "convert_pdf_to_png": {
    "success": true,
    "payload": {
      "files": [
        {
          "fileuuid": "8142ce6c-f3cd-526c-a5d3-747799ed2b01",
          "filename": "report_1.png",
          "originalname": "report_1.png",
          "contentType": "image/png",
          "visibility": "private"
        },
        {
          "fileuuid": "8142ce6c-f3cd-526c-a5d3-747799ed2b02",
          "filename": "report_2.png",
          "originalname": "report_2.png",
          "contentType": "image/png",
          "visibility": "private"
        }
      ],
      "attachments": [...]
    }
  }
}