For developers

PDF tools for your product.

Send a file to a mepdf tool and receive the processed file in one HTTPS request.

01 · Quick start

One request, one result.

Use HTTPS and multipart/form-data. Send the input under files; repeat that field for operations that take multiple files. A successful response is the finished PDF or ZIP, not JSON.

curl --fail-with-body \
  -F 'files=@document.pdf' \
  https://mepdf.com/api/pdf/compress \
  --output mepdf_result.pdf
02 · Starter clients

Python and Node.js

Small server-side examples for the current beta endpoint. They return the response bytes so your app can store or stream them.

Python · requests

Download client
import requests

with open("document.pdf", "rb") as source:
    response = requests.post(
        "https://mepdf.com/api/pdf/compress",
        files={"files": ("document.pdf", source, "application/pdf")},
        timeout=120,
    )
    response.raise_for_status()
    with open("mepdf_result.pdf", "wb") as result:
        result.write(response.content)

Node.js 18+ · fetch

Download client
import { readFile, writeFile } from "node:fs/promises";

const form = new FormData();
form.append("files", new Blob([await readFile("document.pdf")]), "document.pdf");
const response = await fetch("https://mepdf.com/api/pdf/compress", {
  method: "POST",
  body: form,
});
if (!response.ok) throw new Error(await response.text());
await writeFile("mepdf_result.pdf", Buffer.from(await response.arrayBuffer()));
03 · Endpoint reference

Available operations

The operation name is the final part of each endpoint. Tool pages link back to their matching API entry.

Merge PDF

Combine PDFs in the order you choose.

POST /api/pdf/merge · multipart/form-data · Upload 2–12 files · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput files (repeat this field for each file)Binary upload, repeatedYes
page_orderOrdered source page manifest (JSON, optional)JSON · One object per input page: file index, page number, rotationOptional
Open Merge PDF ↗

Split PDF

Preview your pages and split by range, count, selection or size.

POST /api/pdf/split · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pagesPages or rangestext · 1-3,5Required
Open Split PDF ↗

Rotate PDF

Turn every page in your PDF clockwise.

POST /api/pdf/rotate · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
degreesClockwise rotationselect · 90, 180, 270Required
Open Rotate PDF ↗

Organize PDF

Rearrange pages by entering them in a new order.

POST /api/pdf/organize · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pagesPage ordertext · 3, 1–2Required
Open Organize PDF ↗

PDF Page Layout

Place multiple PDF pages on each sheet for compact printing.

POST /api/pdf/page-layout · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pages_per_sheetPages per sheet (1, 2, 4, 6, or 9)number · 2Required
sheet_widthSheet width (pt)number · 595Required
sheet_heightSheet height (pt)number · 842Required
marginMargins (pt)number · 24Required
Open PDF Page Layout ↗

Create Booklet

Impose PDF pages on landscape sheets for duplex booklet printing. Print double-sided and flip on the short edge.

POST /api/pdf/booklet · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
page_widthBook page width (pt)number · 595Required
page_heightBook page height (pt)number · 842Required
marginPage margins (pt)number · 18Required
Open Create Booklet ↗

PDF Editor

Add text, ink, highlights, shapes and images; reorder, rotate, insert blank pages or delete pages.

POST /api/pdf/visual-editor · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
manifestEdit operations, page order and rotationsJSON · {"version":1,"pages":[{"source":1,"rotation":0}],"actions":[]}Required
imagesPNG/JPEG assets referenced by image actionsBinary upload, repeat up to five filesConditional
Open PDF Editor ↗

Extract PDF pages

Save selected pages in a new PDF.

POST /api/pdf/extract-pages · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pagesPages to extracttext · 1–3, 5Required
Open Extract PDF pages ↗

Remove PDF pages

Delete selected pages and keep the rest.

POST /api/pdf/remove-pages · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pagesPages to removetext · 2, 4–6Required
Open Remove PDF pages ↗

Crop PDF

Trim margins on all or selected pages.

POST /api/pdf/crop · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
leftLeft margin (pt)number · 0Optional
rightRight margin (pt)number · 0Optional
topTop margin (pt)number · 0Optional
bottomBottom margin (pt)number · 0Optional
pagesPages (blank for all)text · 1–3, 5Optional
Open Crop PDF ↗

Protect PDF

Require a password to open your PDF.

POST /api/pdf/protect · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
passwordNew passwordpasswordRequired
Open Protect PDF ↗

Unlock PDF

Remove encryption using the current password.

POST /api/pdf/unlock · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
passwordCurrent passwordpasswordRequired
Open Unlock PDF ↗

Compress PDF

Optimize PDF storage without reducing image quality.

POST /api/pdf/compress · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open Compress PDF ↗

Repair PDF

Recover pages from a PDF with repairable errors.

POST /api/pdf/repair · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open Repair PDF ↗

Watermark PDF

Add a text watermark across your pages.

POST /api/pdf/watermark · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
textWatermark texttext · ConfidentialRequired
pagesPage selectiontext · all or 1-3,5Optional
Open Watermark PDF ↗

Number PDF pages

Add page numbers starting at the number you choose.

POST /api/pdf/page-numbers · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
startStart numbering atnumber · 1Optional
pagesPage selectiontext · all or 1-3,5Optional
Open Number PDF pages ↗

Flatten PDF

Make form fields and annotations part of the page.

POST /api/pdf/flatten · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open Flatten PDF ↗

JPG & PNG to PDF

Combine images into a PDF, one image per page.

POST /api/pdf/image-to-pdf · multipart/form-data · Upload 1–12 files · accepts .jpg,.jpeg,.png · returns pdf

FieldPurposeFormatRequired
filesInput files (repeat this field for each file)Binary upload, repeatedYes
No extra fields.
Open JPG & PNG to PDF ↗

PDF to JPG

Export PDF pages as JPG files in a ZIP.

POST /api/pdf/pdf-to-jpg · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns zip

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
dpiResolution (72–300 DPI)number · 144Optional
Open PDF to JPG ↗

PDF to PNG

Export PDF pages as PNG files in a ZIP.

POST /api/pdf/pdf-to-png · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns zip

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
dpiResolution (72–300 DPI)number · 144Optional
Open PDF to PNG ↗

Compare PDF text

Generate a PDF report of differences in selectable text.

POST /api/pdf/compare · multipart/form-data · Upload 2 files · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput files (repeat this field for each file)Binary upload, repeatedYes
No extra fields.
Open Compare PDF text ↗

Fill PDF forms

Set named text or choice fields in a fillable PDF.

POST /api/pdf/fill-form · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
fieldsForm values (JSON)textarea · {"Name":"Alex"}Required
Open Fill PDF forms ↗

Annotate PDF

Add a short text note at the top of a page.

POST /api/pdf/annotate · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
textNote texttext · Review this sectionRequired
pagePage numbernumber · 1Optional
pagesPage selectiontext · all or 1-3,5Optional
Open Annotate PDF ↗

Sign PDF

Draw a handwritten signature to stamp on a page.

POST /api/pdf/sign · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pagePage numbernumber · 1Optional
strokesSignature drawingJSON · Normalized stroke coordinatesRequired
pagesPage selectiontext · all or 1-3,5Optional
Open Sign PDF ↗

Word to PDF

Convert a Word document to PDF.

POST /api/pdf/word-to-pdf · multipart/form-data · Upload one file · accepts .docx · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open Word to PDF ↗

Excel to PDF

Convert a Excel document to PDF.

POST /api/pdf/excel-to-pdf · multipart/form-data · Upload one file · accepts .xlsx · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open Excel to PDF ↗

PowerPoint to PDF

Convert a PowerPoint document to PDF.

POST /api/pdf/powerpoint-to-pdf · multipart/form-data · Upload one file · accepts .pptx · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open PowerPoint to PDF ↗

Redact PDF

Black out a rectangle and export an image-only PDF. Searchable text is removed from every page.

POST /api/pdf/redact · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pdf

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
pagePage numbernumber · 1Required
leftLeft (%)number · 5Required
topTop (%)number · 5Required
rightRight (%)number · 40Required
bottomBottom (%)number · 20Required
pagesPage selectiontext · all or 1-3,5Optional
Open Redact PDF ↗

Extract PDF images

Save embedded raster images at their original dimensions in a ZIP.

POST /api/pdf/extract-images · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns zip

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open Extract PDF images ↗

PDF to Markdown

Export selectable text by page to a Markdown file.

POST /api/pdf/markdown · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns md

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open PDF to Markdown ↗

PDF to Word

Export selectable text to an editable Word document with reflowed layout.

POST /api/pdf/pdf-to-word · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns docx

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open PDF to Word ↗

PDF to PowerPoint

Create one slide per PDF page using page images.

POST /api/pdf/pdf-to-powerpoint · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns pptx

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open PDF to PowerPoint ↗

PDF to Excel

Extract tables with visible borders and preserve cell values as text.

POST /api/pdf/pdf-to-excel · multipart/form-data · Upload one file · accepts .pdf,application/pdf · returns xlsx

FieldPurposeFormatRequired
filesInput fileBinary uploadYes
No extra fields.
Open PDF to Excel ↗
04 · Errors and limits

Handle errors by status.

StatusMeaningWhat to do
400Invalid input, missing file or invalid option.Show the response detail and let the user correct the request.
413Uploads exceed the 30 MiB total request limit.Reduce or split the input document.
415Request is not multipart form data.Let the client set the multipart boundary automatically.
429Processing service is busy or throttling requests.Retry with exponential backoff and jitter.
5xxTemporary service or upstream error.Retry a small number of times; do not retry invalid input.

Need a stable, authenticated API?

Developer API keys, account quotas, asynchronous jobs and official published SDK packages are planned separately. Follow this page for the current beta contract.