PDFix REST API
Developer Reference
Process PDFs programmatically. Merge, split, rotate, watermark, OCR images and more — via simple HTTP calls.
Quick Start
Authentication — include in every request:
Authorization: Bearer pfx_your_key_here # or X-Api-Key: pfx_your_key_here
Rate Limits & Pricing
| Tier | Monthly calls | Max file size | Price |
|---|---|---|---|
| Free | 100 / month | 10 MB | RM 0 |
| Pro | Unlimited | 100 MB | RM 19 / month |
Exceeded quota returns HTTP 403. Upgrade to Pro →
Error Responses
| Status | Meaning |
|---|---|
| 401 | Missing or malformed API key |
| 403 | Invalid key, revoked, or monthly quota exceeded |
| 400 | Bad request — missing required field or invalid parameter |
| 500 | Server error processing the PDF |
Error body format:
{ "error": "Description of what went wrong" }Endpoints
/api/v1/pdf/mergeMerge PDFCombine 2 or more PDF files into one.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| files[] | File[] | Yes | Two or more PDF files |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/merge \ -H "Authorization: Bearer pfx_..." \ -F "files[]=@a.pdf" \ -F "files[]=@b.pdf" \ --output merged.pdf
/api/v1/pdf/splitSplit PDFExtract a page range from a PDF.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| from | number | No | Start page (1-indexed, default 1) |
| to | number | No | End page (1-indexed, default last) |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/split \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "from=2" -F "to=5" \ --output pages-2-5.pdf
/api/v1/pdf/rotateRotate PDFRotate pages by 90, 180, or 270 degrees.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| degrees | 90|180|270 | No | Rotation angle (default 90) |
| pages | string | No | 1-indexed page list, e.g. 1,3,5 or [1,3,5]. Default: all |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/rotate \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "degrees=90" \ --output rotated.pdf
/api/v1/pdf/delete-pagesDelete PagesRemove specific pages from a PDF.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| pages | string | Yes | 1-indexed pages to delete, e.g. 2,4 or [2,4] |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/delete-pages \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "pages=2,4" \ --output output.pdf
/api/v1/pdf/extract-pagesExtract PagesKeep only specific pages from a PDF.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| pages | string | Yes | 1-indexed pages to keep, e.g. 1,3,5 |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/extract-pages \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "pages=1,3" \ --output extracted.pdf
/api/v1/pdf/watermarkWatermark PDFStamp a diagonal text watermark on every page.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| text | string | No | Watermark text (default CONFIDENTIAL) |
| color | string | No | Hex color, e.g. #ff0000 (default #ff0000) |
| opacity | number | No | 0–1 opacity (default 0.15) |
| size | number | No | Font size in pt (default 48) |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/watermark \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "text=DRAFT" -F "opacity=0.2" \ --output watermarked.pdf
/api/v1/pdf/add-page-numbersAdd Page NumbersStamp page numbers on each page.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| position | string | No | bottom-center|bottom-right|bottom-left|top-center |
| start | number | No | Starting number (default 1) |
| size | number | No | Font size in pt (default 10) |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/add-page-numbers \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "position=bottom-center" \ --output numbered.pdf
/api/v1/pdf/pdf-to-textPDF to TextExtract text content from a PDF. Returns JSON.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
Returns (JSON)
{ "pages": [{ "page": 1, "text": "..." }], "full_text": "...", "page_count": 5 }Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/pdf-to-text \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf"
/api/v1/pdf/ocr-imageOCR ImageExtract text from a JPG/PNG image — ideal for receipts, ICs, scanned documents. Returns JSON.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| image | File | Yes | JPG or PNG image file |
| lang | string | No | Language: eng|msa|chi_sim|ara (default eng) |
Returns (JSON)
{ "text": "...", "confidence": 92, "words": [{ "text": "Hello", "confidence": 98 }], "lang": "eng" }Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/ocr-image \ -H "Authorization: Bearer pfx_..." \ -F "image=@receipt.jpg" -F "lang=eng"
/api/v1/pdf/image-to-pdfImage to PDFConvert one or more JPG/PNG images to a PDF.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| images[] | File[] | Yes | One or more JPG/PNG images |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/image-to-pdf \ -H "Authorization: Bearer pfx_..." \ -F "images[]=@page1.jpg" -F "images[]=@page2.png" \ --output output.pdf
/api/v1/pdf/flattenFlatten PDFConvert interactive form fields into static, uneditable content.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/flatten \ -H "Authorization: Bearer pfx_..." \ -F "file=@form.pdf" --output flattened.pdf
/api/v1/pdf/protectProtect PDFAdd a password to a PDF.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| password | string | Yes | User password to open the PDF |
| owner_password | string | No | Owner/permissions password (defaults to password) |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/protect \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "password=s3cr3t" \ --output protected.pdf
/api/v1/pdf/cropCrop PDFTrim margins from PDF pages (in points; 1pt ≈ 0.35mm).
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| top | number | No | Points to cut from top (default 0) |
| bottom | number | No | Points to cut from bottom (default 0) |
| left | number | No | Points to cut from left (default 0) |
| right | number | No | Points to cut from right (default 0) |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/crop \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "top=36" -F "bottom=36" \ --output cropped.pdf
/api/v1/pdf/organizeOrganize PagesReorder pages of a PDF.
Parameters (multipart/form-data)
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Source PDF |
| order | string | Yes | New page order as 1-indexed list, e.g. [3,1,2] or 3,1,2 |
Example (curl)
curl -X POST https://pdfix.my/api/v1/pdf/organize \ -H "Authorization: Bearer pfx_..." \ -F "file=@doc.pdf" -F "order=3,1,2" \ --output reordered.pdf
Ready to start building?
Generate your free API key and make your first request in under a minute.
Sign Up Free →