Generate thumbnail
curl --request POST \
--url https://api.pdfbase.dev/v1/convert/image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": {},
"page": 123,
"output": "<string>"
}
'import requests
url = "https://api.pdfbase.dev/v1/convert/image"
payload = {
"source": {},
"page": 123,
"output": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({source: {}, page: 123, output: '<string>'})
};
fetch('https://api.pdfbase.dev/v1/convert/image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pdfbase.dev/v1/convert/image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source' => [
],
'page' => 123,
'output' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pdfbase.dev/v1/convert/image"
payload := strings.NewReader("{\n \"source\": {},\n \"page\": 123,\n \"output\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pdfbase.dev/v1/convert/image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {},\n \"page\": 123,\n \"output\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pdfbase.dev/v1/convert/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": {},\n \"page\": 123,\n \"output\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyConvert
Generate thumbnail
Generate a PNG thumbnail from a single page of a PDF.
POST
/
v1
/
convert
/
image
Generate thumbnail
curl --request POST \
--url https://api.pdfbase.dev/v1/convert/image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": {},
"page": 123,
"output": "<string>"
}
'import requests
url = "https://api.pdfbase.dev/v1/convert/image"
payload = {
"source": {},
"page": 123,
"output": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({source: {}, page: 123, output: '<string>'})
};
fetch('https://api.pdfbase.dev/v1/convert/image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pdfbase.dev/v1/convert/image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source' => [
],
'page' => 123,
'output' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pdfbase.dev/v1/convert/image"
payload := strings.NewReader("{\n \"source\": {},\n \"page\": 123,\n \"output\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pdfbase.dev/v1/convert/image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {},\n \"page\": 123,\n \"output\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pdfbase.dev/v1/convert/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": {},\n \"page\": 123,\n \"output\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPhase
Phase 2 — Useful for thumbnails, previews, and social sharing images.Request
object
required
The PDF to convert.
{ "pdf_id": "pdf_abc123" }{ "url": "https://example.com/doc.pdf" }{ "base64": "JVBERi0x..." }
integer
default:"1"
The page number to render as a thumbnail.
string
default:"url"
url or base64.Response
{
"id": "conv_img1",
"object": "conversion",
"status": "completed",
"image": {
"page": 1,
"url": "https://files.pdfbase.dev/conv_img1_p1.png?token=sig_a",
"width": 1240,
"height": 1754,
"bytes": 180000
},
"created_at": "2026-05-19T13:25:00Z",
"expires_at": "2026-05-20T13:25:00Z"
}
Example
curl -X POST https://api.pdfbase.dev/v1/convert/image \
-H "Authorization: Bearer pk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"source": { "pdf_id": "pdf_report" },
"page": 3,
"output": "url"
}'