Free plan

PDF OCR

Make a scanned PDF searchable and its text copyable
POST
/v1/pdfs/ocr

About this tool

A scanned PDF is only a picture of each page, so you cannot select or search its words. OCR (optical character recognition) means a computer reading the letters in a picture. This tool reads the pages and gives you the text, a searchable PDF, or other formats such as a Word document. You choose the language of the text. The reading can have small mistakes, especially on poor scans.
For example, you scanned a printed book chapter and want to search it for a name and copy a few paragraphs.

How to use it

  1. Choose this tool.
  2. Add your scanned PDF.
  3. Choose the language of the text in the scan.
  4. Choose what you want back: plain text, a searchable PDF, a Word document or another format. You can also straighten crooked pages or clean up noise.
  5. Press Generate, then download or copy the result.

What you get back

You get the text on screen or a new file in the form you chose, such as a searchable PDF. You can copy or download it.
GOOD TO KNOW
Requires tesseract (and LibreOffice for output=docx/pdfa) on the server: runtime capabilities. The maximum pages per request is a server setting (default 20).
TEST IT LIVE

Try PDF OCR in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/ocr
Tool ID
pdfs.ocr
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/ocr" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'output=text' \
  -F 'mode=auto' \
  -F 'dpi=300'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.ocr({
    "file": 'document.pdf',
    "output": "text",
    "mode": "auto",
    "dpi": 300
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->ocr([
    'file' => 'document.pdf',
    'output' => 'text',
    'mode' => 'auto',
    'dpi' => 300,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Make a scanned PDF searchable and its text copyable.

PDF OCR accepts PDF. You can send several files in one request.

PDF OCR is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/ocr with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.