Choosing an OCR API is only part of a reliable document pipeline. This guide gives you a reusable way to check image, PDF, TIFF, and Office document compatibility, validate provider limits, preserve extraction quality, and create a fallback path when an uploaded file is rejected.
Overview
File compatibility affects more than whether an upload succeeds. The same document can produce different OCR results depending on its container, compression, page structure, color mode, embedded text, and security settings. A document OCR API may accept a file extension but reject its actual MIME type, support a PDF but impose a page limit, or process only the first frame of a multipage TIFF.
Do not treat a general statement such as “supports PDF and images” as a complete integration specification. Before production use, record the provider’s supported extensions, accepted MIME types, maximum file size, page or frame limits, asynchronous processing rules, and behavior for searchable or password-protected files. These details belong in your ingestion contract and automated tests.
The compatibility table below is a planning template rather than a list of universal limits. Providers change limits and SDK behavior, so populate the final values from the documentation for the specific OCR API version you use.
| Input type | Common MIME type to validate | Questions to confirm | Quality and processing notes |
|---|---|---|---|
| JPEG or JPG | image/jpeg | What is the maximum file size? Are progressive JPEGs accepted? | Useful for photographs and scans, but repeated compression can soften small text. |
| PNG | image/png | Are transparency and alpha channels supported? Is there a pixel-dimension limit? | Often suitable for screenshots, diagrams, and lossless scans; remove unnecessary transparency if the API cannot interpret it. |
| WebP or other modern image formats | Provider-specific | Is the format accepted directly, or must it be converted first? | Never infer support from browser compatibility. Verify both the API endpoint and the SDK. |
| Single-page TIFF | image/tiff | Are the compression method, bit depth, and color mode supported? | Common in scanning workflows. Some combinations of compression or encoding can cause rejection. |
| Multipage TIFF | image/tiff | Are all frames processed? Is there a frame limit or one-result-per-page response? | Confirm page ordering, output grouping, and behavior when one frame is malformed. |
| PDF with an image scan | application/pdf | What are the maximum file size and page count? Are rotated or mixed-size pages supported? | Ask whether OCR runs on every page and whether the response preserves page boundaries. |
| Searchable or text-based PDF | application/pdf | Does the API extract the existing text, rasterize pages, or perform both operations? | Existing text may be more reliable than OCR, but scanned pages inside the same PDF may still require OCR. |
| Password-protected or encrypted PDF | application/pdf | Can credentials be supplied? Are encrypted files rejected by design? | Decrypt only within an approved, controlled workflow and avoid logging passwords or document contents. |
| DOCX, XLSX, or PPTX | Office-specific | Does the OCR API accept Office files directly, or should they be rendered to PDF or images? | Rendering can change layout, fonts, tables, and reading order. Test the conversion step separately. |
Checklist by scenario
Images from uploads or mobile capture
- Validate the file signature, extension, and MIME type instead of trusting the filename alone.
- Check pixel dimensions, orientation, color mode, and file size before sending the request.
- Rotate images using reliable orientation metadata or a controlled preprocessing step.
- Preserve the original file so you can reproduce an OCR issue without asking the user to upload again.
- Test typical customer images, including shadows, glare, low contrast, cropped edges, and receipts photographed at an angle.
If your application needs structured fields from receipts or invoices, file acceptance is only the first test. Measure whether dates, totals, taxes, and line items remain associated correctly. See the receipt and invoice OCR guide for a field-oriented workflow.
Scanned PDFs
- Determine whether the PDF contains image-only pages, an existing text layer, or a mixture of both.
- Confirm maximum file size, page count, and processing time for synchronous and asynchronous requests.
- Check whether the response returns page-level text, coordinates, confidence values, or only one combined string.
- Test rotated pages, blank pages, mixed orientations, and pages with different dimensions.
- Decide whether the output should be plain text, structured JSON, or a searchable PDF with an added text layer.
For a deeper implementation sequence, use the PDF OCR API guide and the production-ready PDF OCR pipeline checklist.
TIFF archives and scanner exports
- Identify whether each TIFF is single-page or multipage.
- Record compression, bit depth, resolution, and color mode during ingestion.
- Verify that every frame is processed and that output page numbers match the source frame order.
- Set a maximum frame count and reject or split unusually large files before they reach the OCR endpoint.
- Retain a page-level error record so one damaged frame does not silently remove the rest of the document.
Office documents
- Confirm direct Office-file support rather than assuming that an API accepts every document format.
- If conversion is required, define the approved conversion tool and test its output on tables, headers, footers, charts, and tracked changes.
- Decide how to handle spreadsheets with multiple sheets and presentations with speaker notes or text inside shapes.
- Compare extracted text with the rendered pages when reading order matters.
When a provider does not accept the source format, a controlled conversion to PDF or page images is usually easier to test than an undocumented workaround. Treat conversion as a separate stage with its own logging, limits, and quality checks.
What to double-check
Build a provider-specific compatibility record before releasing an OCR integration. Include the endpoint or SDK version, accepted extensions, exact MIME types, size and page limits, supported compression methods, maximum pixel dimensions, multipage behavior, and timeout or job-expiration rules. Note whether limits apply to the whole request, each page, or each individual file.
Also verify security and output behavior. Ask whether password-protected PDFs are accepted, whether searchable PDFs bypass OCR, and whether existing text is returned alongside recognized text. Confirm whether the API preserves page boundaries, reading order, bounding boxes, tables, language selection, and confidence scores. If confidence data is available, define review thresholds rather than accepting every result automatically; the OCR confidence scores guide explains how to route uncertain results.
For sensitive documents, check where preprocessing occurs, how long files and results are retained, and which logs contain filenames or extracted text. Keep these questions separate from format compatibility, but evaluate them before production. The privacy-first OCR workflow and OCR PII redaction workflow provide useful controls for sensitive content.
Finally, test the SDK rather than relying only on raw API documentation. Some clients infer content types, impose their own upload limits, buffer large files in memory, or expose asynchronous jobs differently from the underlying endpoint. Run tests for successful uploads, rejected MIME types, oversized files, malformed documents, timeouts, partial multipage failures, and retried requests.
Common mistakes
- Trusting the extension: A file named .pdf may be malformed, encrypted, or a different format with a misleading name. Inspect the file signature and validate it safely.
- Assuming accepted means accurate: A provider may process a file successfully while producing poor results because of low resolution, blur, compression artifacts, or complex layout.
- Ignoring multipage behavior: A successful response for the first page is not proof that every PDF page or TIFF frame was processed.
- Sending oversized files without preflight checks: This creates avoidable latency, confusing errors, and unnecessary processing costs where usage-based pricing applies.
- Flattening output too early: Discarding page numbers, coordinates, and confidence values makes review, table reconstruction, and troubleshooting harder.
- Converting without measuring: Rendering Office files or PDFs can alter fonts and layout. Compare the converted pages with the originals before relying on the output.
- Building no fallback: Unsupported files should enter a controlled path: identify the type, convert it with an approved tool, retry within defined limits, and route failures for review.
When to revisit
Review this compatibility checklist quarterly and whenever your workflow changes. Revisit it before seasonal planning cycles that introduce new vendors, scanner exports, customer upload channels, or document types. Update it after an OCR API release, SDK upgrade, endpoint migration, file-conversion change, or adjustment to retention and security controls.
Keep a small regression set for every important format: a clear image, a difficult photograph, a single-page PDF, a multipage PDF, a searchable PDF, a multipage TIFF, and each Office format you accept. Run it after provider or preprocessing changes and compare page counts, extracted text, field accuracy, error handling, and processing time.
Before adding a new ingestion source, complete these final actions:
- Capture representative files without sensitive data where possible.
- Record extension, MIME type, size, page or frame count, compression, and security settings.
- Confirm limits and behavior in the current provider and SDK documentation.
- Add pre-upload validation and a clear user-facing error message.
- Define conversion, retry, and human-review paths for unsupported or uncertain files.
- Update automated tests, monitoring, and this compatibility record.
That routine turns file format support from an assumption into a maintained part of your OCR integration. For broader provider selection, compare the criteria in how to choose an OCR API and keep format support alongside accuracy, privacy, output structure, and developer experience.