PDF Operations
Render PDF pages as images
Creates a task to render specified pages of a PDF file as images.
x-api-key
<token>
API Key for authentication
In: header
inputrequired
string
The id of the file or task to operate on.
name
FileName
The name of the file
Length
1 <= length <= 50dpi
integer
Dots per inch (DPI) for the rendered image. Default is 300.
Default
300Range
72 <= value <= 600pages
string
Page range (e.g., 2-7), a comma-separated list (e.g., 2,3,7) of pages.
callback_url
string
The URL to call when the task is completed or failed. If you want to receive events, you probably prefer to use webhooks instead.
Format
uriResponse Body
curl -X POST "https://api.scan-documents.com/v1/pdf-operations/render" \ -H "Content-Type: application/json" \ -d '{ "input": "file_avyrvozb9302uwhq" }'{
"id": "task_euyrvozb9302uwhq",
"operation": "render",
"parameters": {
"input": "file_avyrvozb9302uwhq",
"name": "File Name",
"dpi": 300,
"pages": "2-7",
"callback_url": "https://example.com/callback"
},
"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"
}
]
},
"callback_url": "https://example.com/callback",
"created_at": "2021-05-01T12:00:00Z",
"updated_at": "2021-05-01T12:00:00Z"
}{
"type": "https://scan-documents.com/docs/errors/not-found",
"title": "Not Found",
"status": 404,
"message": "{resource} with id {id} not found."
}{
"type": "https://scan-documents.com/docs/errors/validation-error",
"title": "Validation Error",
"status": 422,
"errors": {
"{field}": [
"{error}."
]
}
}{
"type": "https://scan-documents.com/docs/errors/rate-limit-error",
"title": "Rate Limit Exceeded",
"status": 429,
"message": "Rate limit exceeded. Please try again later or contact support."
}{
"type": "https://scan-documents.com/docs/errors/internal-error",
"title": "An unexpected error occurred. Contact support if the problem persists.",
"status": 500,
"message": "An unexpected error occurred. Contact support if the problem persists."
}