PDF // Engine

Pdf Decreases Filesize

A headless, high-performance document processing unit. Built for speed, secured with HMAC, powered by Ghostscript & Tesseract.

Documentation POST /v1/compress-pdf

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

TaskEngineExpected Output
compressGhostscriptOptimized PDF
ocrTesseractSearchable PDF
webplibwebpImage/WebP
pngGhostscriptImage/PNG (First page)