A tiny, fast, and straightforward REST API for working with PDF files. No complex SDKs. Just pure HTTP.
docker run -p 8080:8080 ghcr.io/borisevstratov/pdf-cut:latestThe API will be available at: http://localhost:8080
services:
pdf-cut:
image: ghcr.io/borisevstratov/pdf-cut:latest
container_name: pdf-cut
ports:
- "8080:8080"Start with:
docker compose up -dGET /health — Health check.
POST /compress — Reduces the size of a PDF file.
Payload:
file(multipart/form-data, optional): PDF fileurl(form-data, optional): Public link to a remote PDF
Response: compressed PDF file
POST /extract — Extracts a range of pages from a PDF.
Payload:
file(multipart/form-data, optional): PDF fileurl(form-data, optional): Public link to a remote PDFpageStart(integer, required): first page to includepageEnd(integer, required): last page to include
Response: a new PDF containing only the selected pages
POST /merge — Combines multiple PDFs into a single document.
Payload:
-
files(multipart/form-data, optional): Multiple PDF files -
urls(form-data, optional): JSON array of public links to PDFs["https://example.com/a.pdf", "https://example.com/b.pdf"]
Running locally:
go run main.go
go build -o pdf-cut .Build with Docker:
docker build -t pdf-cut .
docker run -p 8080:8080 pdf-cut