PDF Operations

Render PDF pages as images

Creates a task to render specified pages of a PDF file as images.

POST
/v1/pdf-operations/render

Authorization

x-api-key
<token>

API Key for authentication

In: header

Request Body

application/jsonOptional
inputrequired
string

The id of the file to operate on.

name
string

The name of the file

Minimum length: 1Maximum length: 30
dpi
integer

Dots per inch (DPI) for the rendered image. Default is 300.

Default: 300Minimum: 72Maximum: 600
pages
string

Page range (e.g., 2-7), a comma-separated list (e.g., 2,3,7) of pages.

Response Body

The response of an render task

TypeScript Definitions

Use the response body type in TypeScript.

responserequired
Render Response

The response of an render task

curl -X POST "https://api.scan-documents.com/v1/pdf-operations/render" \
  -H "x-api-key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "file_avyrvozb9302uwhq",
    "name": "File Name",
    "dpi": 300,
    "pages": "2-7"
  }'
{
  "id": "task_euyrvozb9302uwhq",
  "operation": "render",
  "parameters": {
    "input": "file_avyrvozb9302uwhq",
    "name": "File Name",
    "dpi": 300,
    "pages": "2-7"
  },
  "status": "completed",
  "result": {
    "generated_files": [
      {
        "id": "file_euyrvozb9302uwhq",
        "name": "Example Image",
        "type": "image/png",
        "properties": {
          "size": 1024,
          "width": 800,
          "height": 600
        },
        "task_id": "task_euyrvozb9302uwhq",
        "created_at": "2021-05-01T12:00:00Z"
      }
    ]
  },
  "created_at": "2021-05-01T12:00:00Z",
  "updated_at": "2021-05-01T12:00:00Z"
}