Menu

PDF options

Reference for the pdf options of the shotkit screenshot API, with an example request for each.

Options for format=pdf. Margins accept any CSS length (20px, 1cm, 0.5in).

pdf_print_background

Print background graphics.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_print_background":true}' \
  --fail-with-body -o shot.pdf

pdf_fit_one_page

Fit the whole page on one PDF page.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_fit_one_page":true,"pdf_print_background":true}' \
  --fail-with-body -o shot.pdf

pdf_landscape

Landscape orientation.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_landscape":true}' \
  --fail-with-body -o shot.pdf

pdf_paper_format

Paper size.

Type: enum · Default: letter

Values: a0, a1, a2, a3, a4, a5, a6, legal, letter, tabloid

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_paper_format":"a4"}' \
  --fail-with-body -o shot.pdf

pdf_margin

Margin for all sides (e.g. 20px, 1cm).

Type: string

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_margin":"1cm"}' \
  --fail-with-body -o shot.pdf

pdf_margin_top

Top margin override.

Type: string

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_margin":"1cm","pdf_margin_top":"2cm"}' \
  --fail-with-body -o shot.pdf

pdf_margin_right

Right margin override.

Type: string

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_margin":"1cm","pdf_margin_right":"2cm"}' \
  --fail-with-body -o shot.pdf

pdf_margin_bottom

Bottom margin override.

Type: string

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_margin":"1cm","pdf_margin_bottom":"2cm"}' \
  --fail-with-body -o shot.pdf

pdf_margin_left

Left margin override.

Type: string

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","pdf_margin":"1cm","pdf_margin_left":"2cm"}' \
  --fail-with-body -o shot.pdf