Prompt
My document OCR API is failing on scanned PDFs what should I check?
Latest observation
Nov 17, 2026
OpenAI APIWeb search: off
If your OCR API is failing on scanned PDFs, here’s a practical checklist to narrow it down quickly:
1) Confirm it’s actually a scanned PDF
- Scanned PDFs are usually just images inside a PDF, with no selectable text.
- Test by trying to select/copy text in a PDF viewer.
- If the PDF already has text layers, OCR may not be needed or may behave differently.
2) Check PDF/image quality
OCR often fails or degrades when scans are:
- Too low resolution (aim for 300 DPI or higher)
- Blurry or out of focus
- Skewed/rotated
- Very dark, too bright, or low contrast
- Noisy, compressed, or fax-like
- Handwritten or mixed with unusual fonts
3) Verify API input requirements
Make sure the API accepts:
- The correct file type and MIME type
- The right encoding if sending base64
- Proper multi-part form upload if required
- File size within limits
- Page count within limits
4) Check OCR settings
Some APIs need explicit OCR options:
- Language selection
- Auto-rotate / deskew
- Orientation detection
- PDF-to-image rendering resolution
- Layout mode / document type
- Whether OCR is enabled at all
5) Inspect preprocessing
If you control preprocessing, try:
- Converting pages to images at higher resolution
- Grayscale or binarization
- Deskewing
- Removing noise
- Splitting multi-page PDFs to test individual pages
6) Look at API errors and logs
Check for:
- 400/415: bad format or unsupported type
- 413: file too large
- 422: invalid document or OCR failed
- 500/502: backend/service issues Also inspect:
- Request payload
- Response body
- Correlation/request IDs
- Retry behavior and timeouts
7) Test with known-good samples
Try:
- A simple scanned PDF from a scanner at 300 DPI
- A small one-page PDF
- A PDF with clear printed text If these work, the issue is likely document quality or edge-case formatting.
8) Check page rendering issues
Some PDFs fail because:
- They contain unusual encodings
- Embedded images are corrupted
- There are annotations/forms/overlays
- Pages are extremely large or malformed
9) Validate environment/dependencies
If this is your own service:
- OCR engine version
- PDF renderer version
- Ghostscript/poppler/Tesseract dependencies
- Memory/CPU availability
- Temp disk space
- Container limits
10) Consider page orientation and layout
OCR can fail if:
- Pages are sideways/upside down
- There are multiple columns
- Tables dominate the page
- Text is very small
- Background watermarking interferes
Fast triage plan
- Open the PDF and check if text is selectable.
- Try a single-page, high-quality scan.
- Raise render/OCR resolution to 300 DPI.
- Check the exact API error response.
- Compare a failing PDF with a known-good one.
If you want, paste:
- the API error message,
- a sample request payload,
- and details about the PDF quality/size/page count,
and I can help you pinpoint the likely cause.