Playwright-based PDF generation service with Gotenberg-compatible API.
- Gotenberg-compatible API - Drop-in replacement for URL-to-PDF conversion
- Playwright backend - Fast, reliable Chromium rendering
- Memory efficient - Browser pooling and automatic cleanup
- Concurrent processing - Handles multiple requests with configurable limits
- Docker deployment - Easy setup with included scripts
npm install
npm startService runs on http://localhost:3000
- Clone repository on your EC2 instance:
git clone https://github.com/formester/pdfester.git
cd pdfester- Make setup script executable and run:
chmod +x setup.sh
sudo ./setup.shThis will:
- Install Docker, Docker Compose, Nginx, Certbot
- Build and start the Pdfester service
- Configure SSL with Let's Encrypt
- Set up automatic certificate renewal
curl -X POST \
-u formester:formesterisprintingpdf \
-F "url=https://example.com" \
-F "paperFormat=A4" \
-F "landscape=false" \
https://printer.formester.com/forms/chromium/convert/url \
--output document.pdfurl(required) - URL to convert to PDFpaperFormat- A4, A3, A2, A1, A0, Letter, Legal, Tabloid, LedgerpaperWidth/paperHeight- Custom dimensions (e.g., "8.5in", "21cm")landscape- true/falsemarginTop/marginRight/marginBottom/marginLeft- Margins (e.g., "1in", "2cm")printBackground- true/false (print CSS backgrounds)scale- Scale factor (0.1 - 2)preferCSSPageSize- true/false
curl https://printer.formester.com/healthEnvironment variables:
PDFESTER_USERNAME- Basic auth username (default: formester)PDFESTER_PASSWORD- Basic auth password (default: formesterisprintingpdf)MAX_CONCURRENT- Maximum concurrent PDF generations (default: 3)TIMEOUT- Request timeout in milliseconds (default: 30000)PORT- Server port (default: 3000)
# View status
docker-compose -f /opt/pdfester/docker-compose.yml ps
# View logs
docker-compose -f /opt/pdfester/docker-compose.yml logs -f
# Restart service
docker-compose -f /opt/pdfester/docker-compose.yml restart
# Update service
cd /opt/pdfester
git pull
docker-compose build --no-cache
docker-compose up -d- Memory usage: ~400-800MB per instance
- Concurrent requests: 3 by default (configurable)
- Browser pooling: Reuses browser instances for efficiency
- Automatic cleanup: Prevents memory leaks
- Check service health:
curl http://localhost:3000/health - View container logs:
docker logs pdfester - Test without SSL:
curl -u formester:formesterisprintingpdf http://localhost:3000/health