PDF Tools API

Merge PDFs, extract or split pages, rotate pages, stamp a diagonal watermark or add page numbers (Vietnamese text supported), all in one API.

POSThttps://apibox.io.vn/v1/pdf-tools

One endpoint, several actions. merge joins up to 20 PDFs in order (multipart file1, file2… or a files_base64 array). extract builds a new PDF from pages such as 1-3,5,8-last (in the order given, so 3,1 reorders). split cuts the document every N pages (every) or by ranges (ranges=1-3;4-6) and returns a ZIP of the parts. rotate turns pages by 90, 180 or 270 degrees. info (the default) returns the page count, title, producer and page size.

watermark draws a semi-transparent diagonal text (text, opacity 0.03–1, default 0.15) across each page, sized to the page; page_numbers writes labels such as Trang {n}/{total} (format, position top / bottom + left / center / right, start). Both use the Be Vietnam Pro font, so “BẢN NHÁP” or “Trang 1/5” render with correct diacritics. Every action except merge accepts pages to work on part of the document.

The answer is the resulting PDF (or ZIP for split, JSON for info). Password-protected PDFs are refused; files are processed in memory within the file size of your plan.

Parameters

NameInTypeRequiredDefault
actionquery|bodystringnoinfomerge, extract, split, rotate, watermark, page_numbers or info.
filebodyfileyesThe PDF (multipart, raw body or file_base64). For merge: file1, file2… (up to file10) or files_base64 (array, up to 20).
pagesquery|bodystringnoPages, e.g. 1-3,5,8-last. Required for extract; for rotate / watermark / page_numbers it limits the pages (default: all).
everyquery|bodynumberno1split: pages per part.
rangesquery|bodystringnosplit: explicit parts separated by ;, e.g. 1-3;4-6 (max 200 parts).
anglequery|bodynumberno90rotate: 90, 180 or 270 (-90 also accepted).
textquery|bodystringnowatermark: the text (required, max 100 characters).
opacityquery|bodynumberno0.15watermark: 0.03–1.
formatquery|bodystringno{n} / {total}page_numbers: label with {n} and {total}.
positionquery|bodystringnobottom-centerpage_numbers: top- or bottom- + left, center, right.
startquery|bodynumberno1page_numbers: first number.

Example

curl -X POST "https://apibox.io.vn/v1/pdf-tools" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "0=@./my-file"

Response

{
  "pages": 1,
  "title": "Báo giá",
  "author": null,
  "producer": "APIBox md-pdf",
  "page_size_pt": {
    "width": 595,
    "height": 842
  },
  "actions": [
    "merge",
    "extract",
    "split",
    "rotate",
    "watermark",
    "page_numbers",
    "info"
  ]
}

Use cases

  • Merge an invoice and its appendix into one PDF
  • Stamp “BẢN NHÁP” or “CONFIDENTIAL” on drafts
  • Add page numbers to generated reports
  • Split a scanned bundle into one PDF per document

FAQ

How do I select pages?

pages=1-3,5,8-last; ranges can go backwards (5-1) and pages are taken in the order written.

Can it open password-protected PDFs?

No. Remove the password first; the API answers invalid_pdf otherwise.

Does it compress PDFs?

No, the pages are copied as they are. Use it to merge, split and mark documents.

Related APIs

Start with 1,000 free requests every month. Get free API key →