apyhub
Cover illustration for PDF Automation API Guide 2026: Generate, Merge, Watermark and Extract PDFs
Engineering

PDF Automation API Guide 2026: Generate, Merge, Watermark and Extract PDFs

PDF automation API guide 2026: generate, merge, watermark and extract PDFs

Updated September 2026

01Introduction

PDF automation means generating, editing, combining and reading PDF files from code, with no one opening a PDF editor. A PDF automation API exposes each of those steps as an HTTP endpoint: send HTML and get a PDF, send five files and get one merged PDF, send a PDF and get it back watermarked or as plain text.

This guide builds a complete PDF workflow from six ApyHub APIs, with the cost of each step and of the full run. We follow one example throughout: Ledgerly, a small accounting firm that sends every client a monthly report pack.

02What's new in the 2026 update

  • A six-step PDF workflow, with the API, inputs and cost for each step.
  • Corrected feature descriptions, checked against the current API specs in September 2026.
  • New steps for text extraction, questions about a PDF, and password-protected archives.
  • A section on what the APIs do not cover yet.
  • Access for AI agents through ApyHub MCP.

03What is PDF automation?

PDF automation is the use of software to create and process PDF documents without manual steps. Typical jobs are generating invoices and reports from templates, combining several documents into one pack, stamping every page with a header, footer or watermark, pulling text out of incoming PDFs, and archiving the results.

Teams automate these jobs when the volume grows past what one person can handle by hand, or when the same document has to look identical every time.

04The PDF workflow in six API calls

StepApyHub APIWhat it doesCost per call
1. GenerateHTML Content to PDF APIRenders an HTML string into a PDF, portrait or landscape50 atoms
2. MergeMerge Files to PDF APIConverts up to 10 files (documents, spreadsheets, presentations, PDFs) and merges them into one PDF, in order150 atoms
3. StampApply Footers on PDF APIAdds header and footer text or PNG images, aligned left, center or right100 atoms
4. WatermarkPDF Watermark APIAdds a text or image watermark to every page100 atoms
5. ExtractExtract Text from PDF APIReturns the text of a PDF, with optional page range and region bounds50 atoms
6. ArchiveGenerate Secure Archives APIBundles files into a password-protected ZIP200 atoms

Atoms are ApyHub's unit of usage, where each call's cost reflects the compute behind it. One full run of all six steps costs 650 atoms. On the $16 Pro plan (100,000 atoms a month), that covers about 150 complete report packs a month.

05Step 1: Generate a PDF from HTML

A PDF generation API turns a template into a finished document. The HTML Content to PDF API takes an HTML string in the content field and returns a signed link to the PDF. Set landscape=true for wide reports.

If your HTML lives at a URL or in a file, use the HTML to PDF API. For a live page, use the Webpage to PDF API.

Ledgerly: the firm fills an HTML template with each client's monthly figures and renders it to a two-page PDF summary.

06Step 2: Merge files into one PDF

A merge PDF API combines several files into one document. The Merge Files to PDF API accepts up to 10 file URLs in file_urls, converts any that are not PDFs, and merges them in the order you send them. It also accepts uploads.

Ledgerly: each pack joins the generated summary with the client's bank statement (PDF), the ledger export (XLSX) and the engagement letter (DOCX). One call returns one PDF.

For one-off conversions between formats, such as Word to PDF or PDF to Word, see our comparison of document conversion APIs.

07Step 3: Add headers and footers

The Apply Footers on PDF API stamps text or a PNG image at the top and bottom of the PDF. Set header_text, footer_text, or the image URL fields, and choose left, center or right alignment for each.

Ledgerly: the header carries the firm's logo on the left, and the footer carries the client name and reporting month in the center.

08Step 4: Watermark the PDF

A PDF watermark API marks every page so a document's status or owner is visible on any copy. The PDF Watermark API accepts a PDF as an upload (up to 100 MB) or a URL, plus either watermark_text or watermark_image_url.

bash

· bash
curl -X POST "https://api.eu.apyhub.com/apyhub/apply-watermark-on-pdf/url/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_url":"https://assets.apyhub.com/samples/sample.pdf","watermark_text":"CONFIDENTIAL"}'

The response is a JSON object with a url field that points to the watermarked PDF:

json

· json
{
  "url": "https://s3.amazonaws.com/bucket/watermarked.pdf"
}

Ledgerly: drafts are watermarked "DRAFT" for internal review. Once a partner approves, the final pack is regenerated and watermarked "CONFIDENTIAL".

Try the PDF Watermark API

09Step 5: Extract text from a PDF

A PDF to text API reads a PDF and returns its text as data. The Extract Text from PDF API returns the text in a data field. Use start_page and end_page to limit pages, preserve_paragraphs to keep paragraph breaks, and the coordinate fields (0 to 100) to read only one region of each page.

To ask a question about a PDF instead of reading all of it, the Talk to PDF API takes a PDF and a natural-language question and returns an answer string.

Ledgerly: incoming client invoices arrive as PDFs. The firm extracts the text of page 1 to index each invoice for search, and asks Talk to PDF "What is the total amount due?" to pre-fill its review queue.

10Step 6: Archive in a password-protected ZIP

The Generate Secure Archives API bundles one or more files, by upload or URL, into a password-protected ZIP and returns a signed link. For an archive with no password, use the Generate Archives API.

Ledgerly: the final pack and its source files go into one password-protected ZIP per client per month, and the password is sent to the client separately.

11What the APIs do not cover yet

  • Compressing or splitting PDFs. The catalog has no PDF compression or split API today.
  • Fine watermark placement. The PDF Watermark API applies the watermark to every page. It does not document options for position, opacity or page selection.
  • Merging more than 10 files in one call. For larger packs, merge in batches of 10, then merge the results.
  • Scanned PDFs. Text extraction reads PDFs that contain text. Scanned pages are images and need OCR first, such as the AI Image OCR API.

Test the PDF workflow in Voiden

12PDF automation with AI agents

Every API in this guide is available through ApyHub MCP. An AI agent can discover the PDF APIs, read their schemas and call them directly, with no hand-written wrapper or tool definition. A finance agent can generate a report, watermark it and archive it in one run, or read an incoming PDF and answer questions about it.

Connect ApyHub MCP to your agent

13Conclusion

Ledgerly's monthly report pack went from a manual, hour-per-client job to six API calls: generate, merge, stamp, watermark, extract and archive. Each step is a separate API, so you can use only the ones your workflow needs, and all of them run on one ApyHub subscription alongside over 1,500 endpoints or capabilities in the catalog, which keeps growing.

Start free on ApyHub

14Frequently asked questions

What is PDF automation?

PDF automation is the use of software to create and process PDFs without manual steps: generating documents from templates, merging files, adding headers, footers and watermarks, extracting text, and archiving. A PDF automation API exposes each of these steps as an HTTP endpoint.

What is a PDF generation API?

A PDF generation API creates a PDF from structured input, most often HTML. The HTML Content to PDF API takes an HTML string and returns a link to the PDF, at 50 atoms per call.

How do I merge PDFs with an API?

Send the files to a merge PDF API. The Merge Files to PDF API accepts up to 10 file URLs, converts any non-PDF files, and returns one merged PDF in the order you sent.

Can I merge Word, Excel and PowerPoint files into one PDF?

Yes. The Merge Files to PDF API converts documents, spreadsheets and presentations as part of the merge, so you can send a DOCX, an XLSX and a PDF in the same request.

How do I add a watermark to a PDF with an API?

Send the PDF and your watermark text or image URL to the PDF Watermark API. It applies the watermark to every page and returns the new PDF as a download or a link.

How do I extract text from a PDF with an API?

Use the Extract Text from PDF API. Send a PDF by URL or upload, optionally with a page range or a region of the page, and receive the text in a data field.

Can I extract text from a scanned PDF?

Not directly. Scanned PDFs contain images of text, so run OCR first, such as the AI Image OCR API, on the page images.

Can I ask questions about a PDF with an API?

Yes. The Talk to PDF API takes a PDF and a question such as "What is the total amount due?" and returns an answer string.

Can I compress or split a PDF with ApyHub?

Not today. The catalog does not include a PDF compression or split API. You can compress images before they go into a PDF with the Compress Images API.

How much does a PDF automation workflow cost?

On ApyHub, each step is priced in atoms: 50 for HTML to PDF, 150 for a merge, 100 each for headers and watermarks, 50 for text extraction and 200 for a secure ZIP. The full six-step run costs 650 atoms.

How do I test the PDF APIs?

You have three options. Use Try it on each API's page, such as the PDF Watermark API, to run it on a sample PDF in your browser. Use Voiden, the free, open-source API client from the ApyHub team, to save the six requests as plain Markdown files in your Git repo and run the whole workflow step by step. Or send the curl request shown above from any terminal.

Can AI agents use the PDF APIs?

Yes. Every API in this guide is available through ApyHub MCP, so an agent can discover, read and call them without a custom wrapper.

15About ApyHub

ApyHub is a curated API catalog and trusted operational layer for developers and AI agents. It offers over 1,500 endpoints or capabilities, and the catalog keeps growing. Every API runs on a single subscription billed in atoms, and each API carries machine-readable certification (GDPR, SOC 2, ISO 27001). Every endpoint is MCP-ready by default. ApyHub is headquartered in Amsterdam, with offices in the Netherlands, Greece and India, and serves 65,000+ monthly developer workspaces. The free tier needs no credit card. API providers can list their APIs at apyhub.com/become-a-provider.