Compress
Lossless and lossy PDF optimization using industry-standard Ghostscript profiles.
OCR Engine
Transforming scans into searchable documents via Tesseract (Swe/Eng support).
Visuals
Generate high-quality WebP or PNG thumbnails from any PDF page instantly.
Secure
Stateless HMAC-SHA256 authentication with JSON-based key management.
Implementation Guide
1. Standard Compression
# Generate HMAC and Send
SIG=$(openssl dgst -sha256 -hmac "YOUR_KEY" "doc.pdf" | awk '{print $2}')
curl -X POST https://pdf.tx.lk/ \
-H "X-Signature: $SIG" \
-F "pdf=@doc.pdf" \
-F "task=compress" \
-F "quality=low" \
--output "compressed.pdf"
2. Task Capabilities
| Task | Engine | Expected Output |
|---|---|---|
| compress | Ghostscript | Optimized PDF |
| ocr | Tesseract | Searchable PDF |
| webp | libwebp | Image/WebP |
| png | Ghostscript | Image/PNG (First page) |