DocOCR Server v1.0.0

Headless PDF/OCR conversion service — convert documents to DOCX via API

DocOCR Server converts PDF files and images to editable .docx documents using a multi-stage conversion pipeline. No GUI required — everything is controlled via REST API.

Quick Start

# Convert a PDF (synchronous — waits and returns the .docx)
curl -X POST http://localhost:8000/convert \
  -H "X-API-Key: YOUR_KEY" \
  -F "file=@document.pdf" \
  -F "language=fa" \
  -o result.docx

# Convert a PDF (async — returns a job ID immediately)
curl -X POST http://localhost:8000/convert \
  -H "X-API-Key: YOUR_KEY" \
  -F "file=@document.pdf" \
  -F "async_mode=true"

# Check job status
curl http://localhost:8000/jobs/{job_id} \
  -H "X-API-Key: YOUR_KEY"

# Download the result
curl http://localhost:8000/jobs/{job_id}/download \
  -H "X-API-Key: YOUR_KEY" -o result.docx

Endpoints

Authentication

Pass your API key via the X-API-Key header. Configure it in config.json or via the DOCOCR_API_KEY environment variable. If no key is set, auth is disabled.

Supported Formats

Input: .pdf, .jpg, .jpeg, .png, .tif, .tiff

Output: .docx

Languages: en, fa, ar, tr, fr, de

Conversion Pipeline

  1. LibreOffice / Word — Direct conversion for text-based PDFs
  2. pdf2docx — Structured PDFs with complex layouts
  3. LLM Vision OCR — Scanned documents (OpenAI, Google Gemini, or custom endpoints)

Each stage checks quality and falls back to the next if needed.

Documentation

Swagger UI — Interactive API explorer
ReDoc — Clean API documentation