Stirling PDF OCR: Complete Setup Guide
Set up Stirling PDF OCR with Tesseract language packs, Docker configuration, and troubleshooting. Keep scanned PDFs searchable and private on your own server.
- Stirling PDF uses Tesseract OCR, the same engine powering Google Docs, and runs entirely on your server
- The standard Docker image includes English; download additional language packs via volume mount or in-app download
- OCR processing speed is 1-2 pages per second on a 2-core CPU; accuracy is 95% on clean, typed documents
- Stirling PDF OCR suits small teams processing invoices, contracts, and scanned documents without cloud upload
- Setup takes 10 minutes with Docker Compose and persistent language pack storage
Stirling PDF's OCR engine is Tesseract, the same open-source tool used by Google Docs and Adobe. It comes built into most deployment methods and lets you process documents entirely on your own servers, keeping files private. Here's exactly how to set it up and add language support.
What is Stirling PDF OCR and Why It Matters
Tesseract is the OCR engine inside Stirling PDF. It converts scanned PDFs and images into searchable, selectable text. Tesseract is the same engine powering Google Docs OCR and is maintained by Google as an open-source project.
For a small team processing contracts, invoices, or archived documents, this matters because you avoid uploading files to iLovePDF, Adobe, or Smallpdf. Files stay on your server. No third-party logging. No data mining for AI training.
Stirling PDF OCR is accurate on clean documents (typed text, good resolution) but struggles with handwritten notes, faded scans, or non-Latin scripts without additional tuning. It's single-threaded by default, so OCR processing speed depends on CPU and document complexity, not number of files in the queue.
The tradeoff: you manage language packs and resource limits yourself. Cloud tools like Adobe handle this for you. Stirling PDF gives you privacy and control over resource allocation, but you own the operations burden.
Which Stirling PDF Deployment Methods Include OCR?
OCR support depends on how you deploy Stirling PDF. Not every variant includes Tesseract by default. Check your deployment method before assuming OCR is available.
The standard Docker image includes OCR with English only. The "ultra-lite" variant (designed for minimal disk space) does not include OCR at all. The "fat" Docker image includes Tesseract and multiple language packs pre-loaded.
If you deploy Stirling PDF as a JAR (Java Archive) on bare metal, you need to install Tesseract separately on the host OS. For Linux, install the tesseract-ocr package via apt, yum, or your package manager. For Windows, download the Tesseract installer from GitHub. For macOS, use Homebrew: brew install tesseract.
If you use Stirling PDF through a Docker container, the standard image is usually the right choice. If disk space is critical (some teams run on 1-2 GB containers), you will need to handle the ultra-lite trade-off and add OCR manually.
Opsily's managed Stirling PDF hosting includes OCR by default in the standard deployment, with persistent volume support for language packs. This saves you the configuration work.
Default Languages in Stirling PDF
Tesseract ships with language data files, called tessdata. The standard Docker image includes English. That's it.
If your team works in German, French, Portuguese, or Simplified Chinese, you need to add those language packs. This is where most people get stuck: the official docs explain how, but the user experience is thin.
Tesseract has two language-data modes: tessdata (larger, more accurate) and tessdata_fast (smaller, faster). Both are available from the GitHub Tesseract repository. The standard Docker image uses tessdata by default for English.
If you need multiple languages right now, pick the fat image. If you're starting with English and adding languages later, the standard image plus a volume mount is the cleaner path.
How to Add More OCR Languages: Three Methods
You have three ways to add language support. Each has a tradeoff.
Method 1: In-App Download (Easiest but Ephemeral)
Inside Stirling PDF, go to Settings > Server > Advanced > OCR. If Tesseract is installed, you will see a "Download language" dropdown. Select the language (German, French, etc.) and click Download.
This works. The language pack installs to the container's filesystem. If you restart the container, the download persists within that container instance. If you rebuild the container or deploy a new instance, you lose it. This is fine for testing. Not recommended for production.
Method 2: Docker Volume Mount (Persistent, Recommended)
Create a directory on your host system (e.g., /opt/stirling-tessdata). Download the language pack from https://github.com/UB-Mannheim/tesseract/wiki (tessdata folder). Copy the .traineddata files into /opt/stirling-tessdata.
In your Docker Compose file, add a volume mount:
volumes:
- /opt/stirling-tessdata:/usr/share/tessdata
Restart Stirling PDF. The language pack persists even if you rebuild the container.
Method 3: Non-Docker (Install via Package Manager)
If you run Stirling PDF as a JAR on bare metal or a Linux VM, install language packs via your OS package manager.
On Ubuntu/Debian:
apt install tesseract-ocr-deu
apt install tesseract-ocr-fra
apt install tesseract-ocr-por
On RHEL/CentOS:
yum install tesseract-langpack-deu
Tesseract finds these automatically. No configuration needed. This is the simplest path if you are not using Docker.
Step-by-Step Docker Compose Setup
Here is the configuration that works. This assumes you have Docker and Docker Compose installed and you want English plus German OCR.
First, create the tessdata directory on your host:
mkdir -p /opt/stirling-tessdata
Download the German language file from the Tesseract repository and save it to /opt/stirling-tessdata/deu.traineddata. See https://github.com/UB-Mannheim/tesseract/wiki for the current download location and available language packs.
Create your docker-compose.yml file:
version: '3.8'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- "8080:8080"
environment:
- LANGS=en,deu
volumes:
- /opt/stirling-tessdata:/usr/share/tessdata
restart: unless-stopped
Start the service:
docker-compose up -d
Verify OCR is working by opening Stirling PDF in your browser. Navigate to Tools > OCR PDF or OCR PDF (Searchable). Upload a document, select the language (English or Deutsch), and click Process. The OCR should complete in seconds for a single page.
You can add more languages by downloading their .traineddata files to /opt/stirling-tessdata and updating the LANGS environment variable.
OCR Accuracy and Performance
Tesseract's accuracy on English clean documents is around 95%. On other languages or low-resolution scans, expect 60-80%.
Two language-data options exist:
tessdata: Larger, slower, more accurate. Use this for documents with complex layouts, multiple fonts, or poor image quality.
tessdata_fast: Smaller, faster, less accurate. Use this for high-volume OCR on clean documents where speed matters more than perfect accuracy.
Performance depends on several factors. CPU speed matters most: Tesseract is CPU-bound. A modern 2-core processor handles about 1-2 pages per second. A 4-core processor, 2-4 pages per second.
Document complexity affects speed too. A simple scanned text page is faster than a page with handwritten notes, tables, or mixed layouts.
Image resolution is critical. 300 DPI scans are optimal. 150 DPI is acceptable. Below 100 DPI, accuracy drops sharply.
Language pack size also impacts performance. English tessdata is about 100 MB. German is about 150 MB. If you load many language packs, startup time increases.
For a 50-page scanned document on a 2-core processor with English tessdata, expect 1-2 minutes of processing.
If you need faster OCR, consider cloud alternatives like Google Vision API or Adobe's OCR service. These are pre-tuned for speed and accuracy. If you need very high accuracy on handwritten documents, Tesseract is not the right tool. Neither is Stirling PDF. You need specialized handwriting-recognition software.
When Stirling PDF OCR Isn't the Right Fit
Stirling PDF OCR is excellent for one specific job: converting typed, scanned PDFs into searchable text on your own server.
It is not the right choice if you process handwritten documents. Tesseract struggles with cursive or casual handwriting. Cloud tools with AI training do better.
It is not the right choice if you need language mixing in a single document. Tesseract is single-language per job. If a contract is 80% English and 20% German, you need a different tool.
It is not the right choice if you want zero infrastructure. Uploading to iLovePDF (EUR 60/year for 2,500 files) or cloud services is easier than running Stirling PDF.
It is not the right choice if you need sub-second latency for high-volume OCR (1,000+ pages/day). Cloud APIs scale horizontally. Stirling PDF on a single server will bottleneck. You can run Stirling PDF in a Kubernetes cluster with auto-scaling, but that is significantly more complex to operate.
It is not the right choice if you have sensitive compliance requirements (HIPAA, FedRAMP). Stirling PDF is not certified. If your legal team requires a certified OCR service, cloud providers with appropriate certifications are your only option.
Compare Stirling PDF to alternatives on our open-source PDF editor guide, which covers BentoPDF and other self-hosted options. For cloud-based alternatives, see Stirling PDF vs. Adobe Acrobat and our iLovePDF alternative overview.
Troubleshooting Common OCR Issues
OCR tool is missing or grayed out
This means Tesseract is not installed or not detected. If you are using the ultra-lite Docker image, you must install Tesseract manually or switch to the standard or fat image.
If you are using Docker standard, restart the container: docker restart <container-name>. If the OCR tool still does not appear, check that you are on the latest image version: docker pull frooodle/s-pdf:latest and restart.
Language not found when selecting OCR
You have installed the language but Stirling PDF is not detecting it. This usually means the .traineddata file is in the wrong location.
Check /usr/share/tessdata (inside the container). If the volume mount is correct, the file should be there. Use docker exec <container-name> ls -la /usr/share/tessdata to verify.
If the file is missing, download it again and check the file name. Tesseract language files are named <language-code>.traineddata (e.g., deu.traineddata, not deu or deutsch).
OCR is very slow or times out
OCR is CPU-intensive. If processing a single page takes more than 30 seconds, you likely have resource constraints.
Check your Docker resource limits. By default, containers can use all available CPU. If your host is under other load, Stirling PDF's OCR will be slow. Allocate specific CPU cores or increase container CPU limits in docker-compose.yml:
resources:
limits:
cpus: '2'
memory: 2G
Also check image resolution. If the uploaded file is 5000x5000 pixels, downscale it before OCR.
Accuracy is poor on the output
Poor accuracy usually means one of three things:
Image quality: Scans below 150 DPI are low-confidence. Rescan or use a better source.
Wrong language selected: If you OCR a German document but select English, accuracy is 0%.
Document layout: Tesseract struggles with multi-column layouts, images mixed with text, or extreme rotation angles. If this is a one-off issue, manually correct the text or use a commercial tool. If this is recurring, invest in preprocessing (rotation correction, deskewing) before OCR.
Frequently Asked Questions
How good is Stirling PDF's OCR compared to Adobe?
Adobe's OCR is AI-tuned on millions of documents and handles handwriting, mixed layouts, and language mixing better. Tesseract (Stirling's engine) is more accurate on clean, typed documents. For standard business documents (invoices, contracts, scanned letters), both are roughly equivalent. Adobe charges per user; Stirling is free.
Can Stirling PDF OCR a PDF that is already encrypted?
No. If the PDF is password-protected or restricted, you must remove the encryption first. Stirling PDF has a "Remove Encryption" tool in the UI that works without a password on many PDFs.
Is Stirling PDF OCR safe to use on confidential documents?
Yes, if you host it on your own server or use a trusted provider. Files processed by Stirling PDF stay on your server and are not sent to third parties. Cloud OCR services may log usage for analytics or improvement purposes.
Can I OCR documents in handwriting with Stirling PDF?
Tesseract is poor at handwriting. It is tuned for printed text. If you need handwriting recognition, use specialized AI tools. These use machine learning trained on handwritten samples.
How do I batch OCR 1,000 PDFs?
Stirling PDF's UI processes one file at a time. For batch operations, use the REST API (POST /api/v1/process/ocr with file upload). Write a Python or Bash script to loop through your PDF directory and call the API for each file. This scales linearly with your CPU.
Can I run Stirling PDF OCR in a Docker Swarm or Kubernetes cluster?
Yes. Deploy multiple Stirling PDF replicas behind a load balancer. OCR requests distribute across replicas. Language packs must be shared via a persistent volume (NFS, managed storage) or baked into the container image.
What is the difference between tessdata and tessdata_fast?
tessdata: about 100 MB per language, 95% accuracy, slower processing. tessdata_fast: about 20 MB per language, 85-90% accuracy, faster processing. Choose tessdata for archival documents or legal contracts. Choose tessdata_fast for high-volume processing of newer documents.
How do I keep language packs persistent across container restarts?
Mount a host directory as a Docker volume pointing to /usr/share/tessdata. Download language files to that directory before starting the container. This persists through restarts and rebuilds.
The Bottom Line
Stirling PDF's OCR is Tesseract, the same engine inside Google Docs. It converts scanned PDFs into searchable text on your own server, keeping files private.
Setup is straightforward: use the standard Docker image, mount a volume for language packs, and download the languages you need. Processing speed is 1-2 pages per second on a 2-core CPU. Accuracy is 95% on clean English documents.
The right choice if you are a small team handling batch OCR without uploading to iLovePDF or cloud services. The wrong choice if you process handwriting, need sub-second latency, or require compliance certifications.
Host Stirling PDF yourself or use a managed provider like Opsily that handles language pack persistence and resource scaling. Ready to start? Check out our managed Stirling PDF hosting and explore how to run it on your own infrastructure.