PaperLab

A self-hosted PDF workshop with 41 tools, from merge and compress to OCR, redaction and chat with a document. A Go API drives Poppler, Ghostscript, qpdf, Tesseract and LibreOffice behind a no-build front end.

Source on GitHub

Status
Active
Area
Web and services
Timeline
Since Oct 2026
Stack
Go, Gin, Vanilla JS, Poppler, Ghostscript, qpdf, Tesseract, Docker

PaperLab is the PDF toolbox I wanted to run on my own machine instead of uploading documents to someone else's. It is a single Go binary that serves a plain ES-module front end and an asynchronous job API, and it ships as a Docker image with every conversion engine included.

What it does

  • Organise: merge, split, extract, reorder, rotate, crop, N-up and booklet layouts.
  • Optimise: compress, repair, OCR, PDF/A and flatten.
  • Convert: PDF to Word, PowerPoint, Excel, images, text or Markdown, and back again from Office files, images and HTML.
  • Edit and secure: sign, watermark, number pages, edit metadata, protect, unlock, redact and compare.
  • Forms and intelligence: fill and extract forms, summarise, translate and ask questions about a document. Without an AI provider configured, summaries and answers fall back to local extraction and retrieval.

How it is built

  • Jobs, not requests. An upload creates a job with a random 128-bit ID and its own in, work and out directories. The client polls for progress and downloads outputs when the job is done. Jobs time out, recover from panics and are deleted after a configurable TTL.
  • Engines are detected, not assumed. At startup PaperLab looks for each external binary and reports which tools are available at /api/tools, so a bare Go install degrades cleanly instead of failing halfway through a job.
  • Careful with URLs. HTML-to-PDF fetches remote pages, so URLs that resolve to loopback, private, link-local or documentation ranges are rejected unless local fetching is explicitly enabled.
  • Small surface. An optional API key, per-IP rate limiting, trusted-proxy handling and an unprivileged Docker user.

What's open

  • Jobs start immediately, so thirty Office conversions start thirty LibreOffice processes. A semaphore per engine would cap that.
  • Job state lives in memory, so a restart reports running jobs as not found instead of interrupted.

Notes