Integration & Embedding

PDF API: What It Does and How to Choose Between a Hosted Service and Open Source Tools

What a PDF API call looks like, which jobs it covers, and when open source tools are the better choice, licenses included.

Marcus Chen · July 2, 2026

Abstract cover with orange, teal and yellow shapes on black, for a guide to choosing a PDF API

A PDF API is a programming interface that lets your own software create, convert or change PDF files: your app sends a file and an instruction, and gets the processed PDF back. It's either a hosted web service you call over HTTP, or a library and command line tool you run on your own server.

Which one fits depends on how many files you process, how sensitive they are, and whether you want to pay per document or maintain the setup yourself.

What a PDF API Can Do

Most PDF APIs, hosted or self-run, cover the same groups of jobs:

  • Conversion: Word, Excel, PowerPoint, HTML and images to PDF, and PDF to Word, Excel, text or images.
  • Page work: merge, split, extract, delete, rotate and reorder pages.
  • File work: compress, repair, add or remove passwords, flatten forms, edit metadata.
  • Content: add watermarks, page numbers or Bates numbers, fill form fields, redact text.
  • Text: extract text, and run OCR on scans to make them searchable.

Digital signatures and hosted e-signing workflows are a separate group, and only some services offer them.

How a Hosted PDF API Works

A hosted PDF API is a web service. You sign up, get an API key, and send files to it in HTTP requests.

  1. Create an account with the provider and generate an API key in its developer dashboard.
  2. Store the key in an environment variable, never in your source code.
  3. Send a POST request with the file (usually as multipart form data) and the operation you want.
  4. Download the result, either from the response itself or from a link the service returns.

The exact endpoint names and parameters are different for every provider, so their own documentation is the reference. Plan for rate limits too: when the service answers with HTTP 429, wait and retry with growing pauses.

Hosted PDF API Providers

You'll come across these names when you compare services. Prices and free tiers change often, so check each provider's current pricing page instead of trusting a list.

The Adobe Developer Console landing page with a Launch Adobe Developer Console button, where developers get keys for the Adobe PDF Services API
  • Adobe PDF Services API: Adobe's cloud service for working with PDFs, set up through the Adobe Developer Console.
  • PDF.co: a REST API for PDF conversion, editing and extraction.
  • iLoveAPI: the developer version of the iLovePDF web tools, with libraries for PHP, .NET, Ruby and Node.js.
  • Nutrient (formerly PSPDFKit): SDKs and hosted document APIs.
The PDF.co home page headed Eliminate PDF Processing Problems, describing its REST API for PDF conversion, editing and extraction

Before you send customer documents to any of them, read the data retention terms: how long files are kept, where they're processed, and whether a data processing agreement is available.

The iLoveAPI home page with the headline All our tools in a REST API for developers and links for PHP, .NET, Ruby and Node.js

Open Source PDF Tools You Can Run Yourself

If you'd rather keep files on your own servers and pay nothing per document, open source tools do most of the same jobs.

  • pdf-lib (JavaScript, Node and browser, MIT): merge, split, rotate, fill forms, add text and images. See the pdf-lib documentation.
  • qpdf (command line, Apache 2.0): repair, encrypt and decrypt, split, merge, and linearize for Fast Web View. Its command line reference lists every option.
  • Ghostscript (AGPL or commercial, see below): compression, PDF/A, grayscale, and rendering pages to images.
  • LibreOffice in headless mode (Mozilla Public License 2.0): Word, Excel and PowerPoint to PDF.
  • Tesseract (Apache 2.0): OCR for scans.
  • Apache PDFBox (Java, Apache 2.0): text extraction, forms and page work.

Is Ghostscript Free for a Commercial Service?

No charge, but read the terms if you're building a service on it: Artifex offers its open source products under the AGPL or a commercial license. Its licensing page sends you to Artifex's own, which says you can't deploy them "as part of a server-based application or service" without disclosing your application's full source code.

So a closed-source product that runs Ghostscript on its servers needs a commercial license from Artifex, unless it can meet the AGPL's terms. Artifex says a commercial license lets you avoid that disclosure. This is a licensing point for you to check with your own lawyer, not legal advice.

Merge Two Files With pdf-lib

Merging two files with pdf-lib in Node takes a few lines. Install it first with npm install --save pdf-lib.

1import { PDFDocument } from "pdf-lib";
2import { readFile, writeFile } from "node:fs/promises";
3
4const merged = await PDFDocument.create();
5for (const file of process.argv.slice(2)) {
6  const doc = await PDFDocument.load(await readFile(file));
7  const pages = await merged.copyPages(doc, doc.getPageIndices());
8  pages.forEach((page) => merged.addPage(page));
9}
10await writeFile("merged.pdf", await merged.save());

Save it as merge.mjs and run it as node merge.mjs a.pdf b.pdf. We ran it in November 2026 with pdf-lib 1.17.1. Two plain files merged, and a file with a password stopped the script with an "is encrypted" error, so decrypt those first.

Hosted PDF API or Self-Hosted: How to Decide

A hosted service is quicker to start with: no servers, no installs, and conversions keep working as the provider updates them. You pay per document or per credit, and your files leave your systems.

Self-hosting costs time instead of money. You install and update Ghostscript, LibreOffice and the rest, give them enough memory, and watch for malformed files. In return, files never leave your servers and there's no cost per document, once you've settled each tool's license.

Rough rule: for a prototype or a few hundred files a month, start with a hosted API. For sensitive documents, or when the bill grows, move the jobs you run most to open source tools, after you've checked their licenses.

When You Don't Need a PDF API at All

If a person handles the files one batch at a time, a browser tool is often enough. pdf-file.com doesn't offer a public API, but every tool on our list of all PDF tools is free to use in the browser, and uploads are deleted within two hours.

Frequently Asked Questions about the PDF API

Is there a free PDF API?

Check each hosted service's pricing page, since free tiers change. The open source tools cost nothing per document, but you run them yourself and follow their licenses, and Ghostscript's AGPL terms matter if you're building a closed-source service.

Does pdf-file.com have an API?

No. Our tools work in the browser only. For automation, use the open source tools above or a hosted service.

Is it safe to send documents to a PDF API?

It depends on the provider's retention and security terms. For confidential files, self-hosted tools keep everything on your own servers.

Try it on your own file