Generate a PDF
curl --request POST \
--url https://api.pictify.io/pdf/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateUid": "<string>",
"variables": {},
"options": {
"preset": "A4",
"customSize": {
"width": 123,
"height": 123
},
"margins": {
"top": 123,
"bottom": 123,
"left": 123,
"right": 123
},
"title": "<string>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateUid: '<string>',
variables: {},
options: {
preset: 'A4',
customSize: {width: 123, height: 123},
margins: {top: 123, bottom: 123, left: 123, right: 123},
title: '<string>'
}
})
};
fetch('https://api.pictify.io/pdf/render', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/pdf/render"
payload = {
"templateUid": "<string>",
"variables": {},
"options": {
"preset": "A4",
"customSize": {
"width": 123,
"height": 123
},
"margins": {
"top": 123,
"bottom": 123,
"left": 123,
"right": 123
},
"title": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/pdf/render"
payload := strings.NewReader("{\n \"templateUid\": \"<string>\",\n \"variables\": {},\n \"options\": {\n \"preset\": \"A4\",\n \"customSize\": {\n \"width\": 123,\n \"height\": 123\n },\n \"margins\": {\n \"top\": 123,\n \"bottom\": 123,\n \"left\": 123,\n \"right\": 123\n },\n \"title\": \"<string>\"\n }\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))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/pdf/render")
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 \"templateUid\": \"<string>\",\n \"variables\": {},\n \"options\": {\n \"preset\": \"A4\",\n \"customSize\": {\n \"width\": 123,\n \"height\": 123\n },\n \"margins\": {\n \"top\": 123,\n \"bottom\": 123,\n \"left\": 123,\n \"right\": 123\n },\n \"title\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"url": "<string>",
"userStorageUrl": "<string>",
"pageCount": 123,
"preset": "<string>",
"pageSize": {
"width": 123,
"height": 123
}
}PDFs
PDF Generation
Generate single and multi-page PDFs from templates
POST
/
pdf
/
render
Generate a PDF
curl --request POST \
--url https://api.pictify.io/pdf/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateUid": "<string>",
"variables": {},
"options": {
"preset": "A4",
"customSize": {
"width": 123,
"height": 123
},
"margins": {
"top": 123,
"bottom": 123,
"left": 123,
"right": 123
},
"title": "<string>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateUid: '<string>',
variables: {},
options: {
preset: 'A4',
customSize: {width: 123, height: 123},
margins: {top: 123, bottom: 123, left: 123, right: 123},
title: '<string>'
}
})
};
fetch('https://api.pictify.io/pdf/render', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/pdf/render"
payload = {
"templateUid": "<string>",
"variables": {},
"options": {
"preset": "A4",
"customSize": {
"width": 123,
"height": 123
},
"margins": {
"top": 123,
"bottom": 123,
"left": 123,
"right": 123
},
"title": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/pdf/render"
payload := strings.NewReader("{\n \"templateUid\": \"<string>\",\n \"variables\": {},\n \"options\": {\n \"preset\": \"A4\",\n \"customSize\": {\n \"width\": 123,\n \"height\": 123\n },\n \"margins\": {\n \"top\": 123,\n \"bottom\": 123,\n \"left\": 123,\n \"right\": 123\n },\n \"title\": \"<string>\"\n }\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))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/pdf/render")
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 \"templateUid\": \"<string>\",\n \"variables\": {},\n \"options\": {\n \"preset\": \"A4\",\n \"customSize\": {\n \"width\": 123,\n \"height\": 123\n },\n \"margins\": {\n \"top\": 123,\n \"bottom\": 123,\n \"left\": 123,\n \"right\": 123\n },\n \"title\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"url": "<string>",
"userStorageUrl": "<string>",
"pageCount": 123,
"preset": "<string>",
"pageSize": {
"width": 123,
"height": 123
}
}PDF Generation
Generate PDFs from templates with support for multiple pages, standard paper sizes, and custom dimensions.Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /pdf/render | Render PDF from a template |
POST | /pdf/multi-page | Multi-page PDF with different content per page |
GET | /pdf/presets | List presets for paper sizes |
Paper Size Presets
| Preset | Dimensions | Description |
|---|---|---|
A4 | 210 x 297 mm | ISO standard, most common worldwide |
Letter | 8.5 x 11 in | US standard letter size |
Legal | 8.5 x 14 in | US legal size |
A3 | 297 x 420 mm | Large format |
A5 | 148 x 210 mm | Compact size, booklets |
custom | User-defined | Specify with customSize |
Key Options
| Parameter | Type | Default | Description |
|---|---|---|---|
preset | string | A4 | Paper size preset |
landscape | boolean | false | Landscape orientation |
margins | object | - | Page margins (top, bottom, left, right) in pixels |
customSize | object | - | Custom dimensions when preset is custom |
printBackground | boolean | true | Include CSS backgrounds |
scale | number | 1 | Scale factor (0.1-2.0) |
The
userStorageUrl response field is only included if you have configured custom storage.Best Practices
- Design for print — use CMYK-friendly colors and sufficient margins
- Test at scale — preview PDFs at 100% zoom before production
- Optimize images — use appropriate resolution (150-300 DPI for print)
- Consider page breaks — design templates with natural page breaks for multi-page docs
- Use web-safe fonts — or embed custom fonts in your template
Authorizations
API key obtained from the Pictify dashboard
Body
application/json
⌘I