PDF to PDF HTTP API Examples

These examples demonstrate common PDF to PDF API workflows via HTTP API.

You can run the examples below with the displayed API credentials. Update the input URLs and filenames as needed.

Using cURL

Use a Bash-compatible shell.

Basic options

  • -u — Supply your username and API key.
  • -F — Send a form field.
  • -o — Save the response to a file.
  • -f — Report HTTP errors as command failures.
  • -s -S — Hide the progress meter while keeping error messages.

File input

  • f_1=@document.pdf — Upload a local file.

Diagnostics

  • --fail-with-body — Use instead of -f to retain the error response body.
  • -D — Save response headers to a file.
  • -w — Print response information; the diagnostic example prints the HTTP status.

Basic examples

Multiple PDFs to PDF file

curl -f -s -S \
  -u 'demo:demo' \
  -o offer.pdf \
  -F f_1=@cover.pdf \
  -F f_2=@proposal.pdf \
  -F f_3=@price.pdf \
  -F f_4=@contact.pdf \
  -F input_format=pdf \
  https://api.pdfcrowd.com/convert/24.04/

Watermark a PDF file

curl -f -s -S \
  -u 'demo:demo' \
  -o company_offer.pdf \
  -F page_watermark=@watermark.pdf \
  -F f_1=@proposal.pdf \
  -F input_format=pdf \
  https://api.pdfcrowd.com/convert/24.04/

Linearize a PDF file

curl -f -s -S \
  -u 'demo:demo' \
  -o linearized.pdf \
  -F f_1=@not_linearized.pdf \
  -F input_format=pdf \
  -F linearize=true \
  https://api.pdfcrowd.com/convert/24.04/

PDF manipulation examples

Extract page 3 and all pages from 7 to the end from the PDF file

curl -f -s -S \
  -u 'demo:demo' \
  -o output.pdf \
  -F f_1=@13_pages.pdf \
  -F input_format=pdf \
  -F action=extract \
  -F page_range=3,7- \
  https://api.pdfcrowd.com/convert/24.04/

Delete the first 3 pages and the 10th page from the PDF file

curl -f -s -S \
  -u 'demo:demo' \
  -o output.pdf \
  -F f_1=@13_pages.pdf \
  -F input_format=pdf \
  -F action=delete \
  -F page_range=1-3,10 \
  https://api.pdfcrowd.com/convert/24.04/