All updates

PDF Tools API, with HTML and Markdown to PDF

DocSpring now has an API for the things you do to a PDF once it exists: split it, rotate or extract pages, encrypt it, add a watermark or page numbers, compress it, and more. Two new endpoints also convert HTML or Markdown to a PDF without creating a template first.

One request for each tool

Each tool has its own endpoint. Send a PDF as a URL, an upload, base64 or a file already in DocSpring, and you get back a job with links to the files it made:

curl https://sync.api.docspring.com/api/v2/jobs/split_pdf \
  -u "$DOCSPRING_TOKEN_ID:$DOCSPRING_TOKEN_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "input": { "type": "url", "url": "https://example.com/contract.pdf" }, "ranges": ["1-2", "3-z"] }'

The tools:

  • Split a PDF into a file per page, every few pages, or by page ranges
  • Extract pages in any order, to remove or reorder pages
  • Rotate pages
  • Encrypt a PDF with a password and limits on printing and copying (AES-256), or decrypt one
  • Add a watermark or page numbers
  • Compress or flatten a PDF
  • PDF to images (PNG or JPEG), and images to PDF
  • PDF to text

HTML and Markdown to PDF, without a template

POST /api/v2/jobs/html_to_pdf takes your HTML and CSS and returns a PDF. It runs on the Standard engine, DocSpring's own fast PDF renderer, or on Chromium when your page needs JavaScript. POST /api/v2/jobs/markdown_to_pdf does the same for Markdown, with our stylesheet for printed documents or your own CSS.

Jobs in the app, webhooks and SDKs

The new Jobs page lists every job and runs any tool on a file you upload. A request to the sync API waits for the job to finish, or add ?wait=false and listen for the job.processed and job.failed webhooks. The tools are in the latest version of every API client and in DocSpring's MCP server, so your AI assistant can use them too.

A job uses 1 credit for a file of up to 10 pages, and you choose how long its files are kept. The PDF tools are part of our current plans: if your account is on a legacy plan, switch plans on the Billing page to use them, or contact support and we'll move your account.

Read more in the PDF tools docs.

Fill your first document today

Test PDFs are free and unlimited. No credit card needed.

Product news by email

New features and changes, once a month.