A lightweight web application that converts PDFs to be compatible with Document Builder using Ghostscript.
Uploaded files are re-processed with Ghostscript to produce a PDF 1.3, A4-sized, printer-quality output — and the converted file keeps its original file name.
- Live: https://pdf-fixer.vanaways.co.uk
- Dev: none
- Drag & drop or browse to upload a PDF
- Converts to PDF 1.3 (A4, printer quality) via Ghostscript
- Preserves original file names on download
- Responsive UI that works on mobile, tablet, and desktop
- Success and error feedback with a loading indicator
- Runs in Docker for easy deployment
- Node.js 24 (see
.nvmrc) - Ghostscript installed and available as
gs
npm install
mkdir -p uploads outputs
npm startOpen http://localhost:3000 in your browser.
npm run lint # ESLint (eslint.config.js)
npm test # node:test, uses a stub gs so Ghostscript is not neededThe page uses Tailwind CSS 3, prebuilt into public/styles.css (committed, so the Docker image needs no build step). After changing classes in public/index.html or public/app.js, rebuild and commit it:
npm run build:cssdocker build -t pdf-fixer .
docker run -p 3000:3000 pdf-fixerThe image is based on node:24-bookworm-slim with Ghostscript installed, and runs as the unprivileged node user.
Deployed on Coolify from the Dockerfile on the main branch (https://pdf-fixer.vanaways.co.uk). Merging to main and redeploying in Coolify ships a change.
- Port:
3000(override withPORT) - Health check:
GET /healthz(the DockerfileHEALTHCHECKuses it; set the same path in Coolify) - No secrets are required.
CI (.github/workflows/ci.yml) runs on every pull request and on pushes to main: npm ci, a syntax check, npm run lint, npm test, a smoke test of GET /healthz, and a Docker build that checks Ghostscript and app start inside the image. Dependabot opens grouped weekly updates for npm, GitHub Actions and the Docker base image.
Upload a PDF file as multipart form data with the field name pdf.
Returns the converted PDF with the original file name preserved.
Example with curl:
curl -X POST -F "pdf=@myfile.pdf" http://localhost:3000/convert --output myfile.pdfError responses:
| Status | Meaning |
|---|---|
| 400 | No file, not a PDF, or a malformed upload |
| 413 | File is larger than MAX_UPLOAD_MB |
| 429 | Rate limit exceeded (RATE_LIMIT_MAX per RATE_LIMIT_WINDOW_MS, per IP) |
| 500 | Ghostscript failed or timed out |
| 503 | MAX_CONCURRENT_JOBS conversions already running; retry shortly |
Returns 200 ok. Use this as the health check path.
All environment variables are optional; see .env.example for the defaults.
| Variable | Default | Purpose |
|---|---|---|
PORT |
3000 |
HTTP port |
MAX_UPLOAD_MB |
50 |
Maximum upload size |
GS_TIMEOUT_MS |
120000 |
Ghostscript timeout per conversion |
MAX_CONCURRENT_JOBS |
2 |
Concurrent Ghostscript jobs |
RATE_LIMIT_WINDOW_MS |
900000 |
Rate limit window for POST /convert |
RATE_LIMIT_MAX |
60 |
Conversions per IP per window |
TRUST_PROXY |
1 |
Express trust proxy (proxy hops in front of the app) |
- Node.js + Express — web server
- Multer — file upload handling
- Ghostscript — PDF conversion
- Tailwind CSS (prebuilt, no CDN) — UI styling
ISC