PDF API
Call 4uPDF's PDF engine from your own apps over a simple HTTP API: high-DPI figure extraction (region → PNG, batch, OCR), core operations (merge, split, compress, PDF-to-JPG), Office conversions (PDF ↔ Word/Excel/PowerPoint) and an OCR searchable-text layer.
Getting a key
The API is available on the Goldplan. Once you're on Gold, open your Dashboard → API Keys, create a key, and copy it (it is shown only once). See Pricing to upgrade.
Authentication
Send your key in the X-API-Key header on every request. Requests without a valid key get 401; a plan without API access gets 403.
X-API-Key: pdf_live_<your_api_key>Selection coordinates
The region is given as page fractions with a top-left origin: fx0,fy0 is the top-left corner and fx1,fy1 the bottom-right, each between 0 and 1. So the left half of a page is fx0=0, fy0=0, fx1=0.5, fy1=1.
Endpoints
POST /api/v1/extract-region
Render one page region to a high-DPI PNG. Returns image/png.
curl -X POST https://4updf.com/api/v1/extract-region \
-H "X-API-Key: $KEY" \
-F "file=@report.pdf" \
-F "page=1" \
-F "fx0=0.1" -F "fy0=0.3" -F "fx1=0.7" -F "fy1=0.4" \
-F "dpi=600" \
-o figure.pngFields: file (PDF), page (1-based), fx0/fy0/fx1/fy1, dpi (72–1200, default 300), fmt (png|tiff, default png), transparent (bool), trim (bool, auto-trim a uniform border).
POST /api/v1/extract-region-svg
Export a page region as a scalable vector image/svg+xml — text and vector art stay crisp at any size.
curl -X POST https://4updf.com/api/v1/extract-region-svg \
-H "X-API-Key: $KEY" \
-F "file=@report.pdf" \
-F "page=1" \
-F "fx0=0.1" -F "fy0=0.3" -F "fx1=0.7" -F "fy1=0.4" \
-o figure.svgPOST /api/v1/extract-region-batch
Apply the same region across a page range. Returns a application/zip of PNGs.
curl -X POST https://4updf.com/api/v1/extract-region-batch \
-H "X-API-Key: $KEY" \
-F "file=@report.pdf" \
-F "fx0=0.1" -F "fy0=0.3" -F "fx1=0.7" -F "fy1=0.4" \
-F "dpi=300" \
-F "page_from=1" -F "page_to=0" \
-o figures.zippage_to=0 means "through the last page". Up to 200 pages per request. Also accepts fmt (png|tiff), transparent, trim.
POST /api/v1/extract-region-ocr
OCR the selected region. Returns JSON { text, lines }.
curl -X POST https://4updf.com/api/v1/extract-region-ocr \
-H "X-API-Key: $KEY" \
-F "file=@report.pdf" \
-F "page=1" \
-F "fx0=0.1" -F "fy0=0.3" -F "fx1=0.7" -F "fy1=0.4"
# => { "text": "Figure 1: ...", "lines": ["Figure 1: ...", ...] }OCR DPI is clamped to 150–600 (accuracy plateaus above that).
POST /api/v1/merge
Merge 2+ PDFs into one. Returns application/pdf.
curl -X POST https://4updf.com/api/v1/merge \
-H "X-API-Key: $KEY" \
-F "files=@a.pdf" -F "files=@b.pdf" \
-o merged.pdfUp to 50 files; combined size follows your plan's limit.
POST /api/v1/split
Split a PDF by page ranges. Returns a application/zip of PDFs.
curl -X POST https://4updf.com/api/v1/split \
-H "X-API-Key: $KEY" \
-F "file=@doc.pdf" \
-F "ranges=1-3,4,5-7" \
-o split.zipranges=all (default) splits into single pages. Each comma part becomes one output PDF.
POST /api/v1/compress
Compress a PDF. Returns application/pdf.
curl -X POST https://4updf.com/api/v1/compress \
-H "X-API-Key: $KEY" \
-F "file=@doc.pdf" \
-F "quality=medium" \
-o compressed.pdfquality = low | medium | high (default medium).
POST /api/v1/pdf-to-jpg
Render PDF pages to JPGs. Returns a application/zip of images.
curl -X POST https://4updf.com/api/v1/pdf-to-jpg \
-H "X-API-Key: $KEY" \
-F "file=@doc.pdf" \
-F "dpi=150" -F "pages=all" \
-o images.zipdpi 36–300 (default 150), pages = all or e.g. 1,3,5-7.
POST /api/v1/pdf-to-word
Extract a PDF's text into an editable Word DOCX. Returns a .docx.
curl -X POST https://4updf.com/api/v1/pdf-to-word \
-H "X-API-Key: $KEY" \
-F "file=@doc.pdf" \
-o converted.docxPOST /api/v1/word-to-pdf
Convert a Word DOCX to PDF. Returns application/pdf.
curl -X POST https://4updf.com/api/v1/word-to-pdf \
-H "X-API-Key: $KEY" \
-F "file=@doc.docx" \
-o converted.pdfPOST /api/v1/pdf-to-excel
Extract PDF tables/text into an Excel XLSX. Returns a .xlsx.
curl -X POST https://4updf.com/api/v1/pdf-to-excel \
-H "X-API-Key: $KEY" \
-F "file=@statement.pdf" \
-o converted.xlsxDetected tables are preserved; otherwise text is laid out by whitespace columns.
POST /api/v1/excel-to-pdf
Convert an Excel XLSX to PDF. Returns application/pdf.
curl -X POST https://4updf.com/api/v1/excel-to-pdf \
-H "X-API-Key: $KEY" \
-F "file=@sheet.xlsx" \
-o converted.pdfPOST /api/v1/pdf-to-powerpoint
Render each PDF page as a slide in a PowerPoint PPTX. Returns a .pptx.
curl -X POST https://4updf.com/api/v1/pdf-to-powerpoint \
-H "X-API-Key: $KEY" \
-F "file=@deck.pdf" \
-o converted.pptxPOST /api/v1/powerpoint-to-pdf
Convert a PowerPoint PPTX to PDF. Returns application/pdf.
curl -X POST https://4updf.com/api/v1/powerpoint-to-pdf \
-H "X-API-Key: $KEY" \
-F "file=@deck.pptx" \
-o converted.pdfPOST /api/v1/ocr-pdf
Add a searchable OCR text layer to a scanned PDF (text becomes selectable/searchable). Returns application/pdf.
curl -X POST https://4updf.com/api/v1/ocr-pdf \
-H "X-API-Key: $KEY" \
-F "file=@scan.pdf" \
-F "dpi=300" \
-o searchable.pdfdpi 150–400 (default 300). Up to 100 pages per request.
Limits & errors
- Monthly call quota is included with your plan (Gold: 10,000 calls/month). When it's reached you get
429until the next month — there is no overage billing. - Max file size follows your plan's limit; oversize uploads return
413. - A degenerate selection, an out-of-range page, or a region too large at the chosen DPI returns
400. - Password-protected PDFs are not supported (
400) — remove the password first. - Office conversions are limited to 200 pages per request, and OCR to 100 pages (
400over the cap) — split large files first.
Ready to build?
Upgrade to Gold, create a key, and make your first call in minutes.