OCR Library in PHP

Requirements
View Demo

Optical Character Recognition (OCR) is the process of taking image-based versions of characters and converting them into machine encoded text. This enables your application to recognize and convert characters from scanned images or image-based documents into machine-readable, searchable text.

This capability is essential for transforming static visual content—such as scanned books, photos of documents, or handwritten forms—into usable digital text that can be indexed, selected, copied, or searched.

Some popular use cases include:

  • Data entry for business documents, e.g. Cheque, passport, invoice, bank statement and receipts
  • Extracting business card information into a contact list
  • making textual versions of printed documents more quickly, e.g. book scanning
  • Making electronic images of printed documents searchable
  • Assistive technology for blind and visually impaired users
  • Making scanned documents searchable by converting them to searchable PDFs

OCR module options

You have three OCR options to choose from when using OCR with the Apryse Server SDK:

  • Default OCR
  • Alternative OCR
  • IRIS OCR

The Apryse Server SDK offers a downloadable default OCR Module as an optional add-on utility in order to use OCR with the SDK. It is currently available on Windows, Linux, and macOS.

The default OCR Module is the newest OCR and delivers strong recognition capabilities across a wide range of document types. Beginning with version 12.0, it is based on modern Deep Learning Neural Networks for better accuracy and a wider variety of OCR language selection.

The default OCR module:

  • Significantly improves accuracy on real-world documents and performs better on low-quality scans and complex layouts.
  • Language coverage is greater and includes CJK, Portuguese, and additional Latin-alphabet languages.
  • Extracted text is available as structured JSON or XML for downstream search, indexing, and AI pipelines – all processed on-premise or server-side, cross-platform, so documents never leave the customer's environment.

The previous V11 OCR Module is still available under the Alternative OCR Module section. For those who prioritize faster processing time on leaner hardware and less memory consumption, the alternative OCR Module may be the better choice.

For advanced layout scenarios—such as pages with multiple disconnected text regions like magazine covers or CAD drawings—you can optionally use the IRIS OCR Module, which may provide improved accuracy and layout interpretation. The IRIS module is available as an additional add-on for Windows and Linux platforms.

Using an OCR module, the SDK can create searchable and selectable text from images or PDFs, producing either a PDF with selectable text, or outputting just the text position data in reusable JSON or XML form.

Performance of V12

The default OCR Module offers about 16% better word recognition accuracy due to its modern Deep Learning Neural Network-based implementation. It does not require a GPU to run.

The alternative and IRIS OCR modules offer 2-3x shorter processing time and less memory usage, ideal for those on limited hardware, or when speed is an absolute priority.

Output Formats and Image Support

Once integrated, the OCR Module enables the SDK to generate Searchable PDFs with selectable text layers

The module takes advantage of pdftron.PDF.Convert.ToPdf internally and accepts multiple image formats, as well as PDFs with only raster images. The result quality depends on image supplied. The ideal image is color or grayscale with resolution in the vicinity of 300 DPI.

Supported Languages (Default OCR)

The default OCR includes models optimized for English-language scenarios, as well as multilingual models supporting over 80 languages.

Latin

  • English - en
  • Afrikaans - af
  • Azerbaijani - az
  • Bosnian - bs
  • Catalan - ca
  • Czech - cs
  • Welsh - cy
  • Danish - da
  • German - de
  • Spanish - es
  • Estonian - et
  • Basque - eu
  • Finnish - fi
  • French - fr
  • Irish - ga
  • Galician - gl
  • Croatian - hr
  • Hungarian - hu
  • Indonesian - id
  • Icelandic - is
  • Italian - it
  • Latin - la
  • Luxembourgish - lb
  • Lithuanian - lt
  • Latvian - lv
  • Māori - mi
  • Malay - ms
  • Maltese - mt
  • Dutch - nl
  • Norwegian - no
  • Occitan - oc
  • Pali - pi
  • Polish - pl
  • Portuguese - pt
  • Quechua - qu
  • Romansh - rm
  • Romanian - ro
  • Serbian (Latin script) - sr-Latn
  • Slovak - sk
  • Slovenian - sl
  • Albanian - sq
  • Swedish - sv
  • Swahili - sw
  • Tagalog - tl
  • Turkish - tr
  • Uzbek - uz
  • Vietnamese - vi

Cyrillic

  • Russian - ru
  • Belarusian - be
  • Ukrainian - uk
  • Serbian (Cyrillic script) - sr-Cyrl
  • Bulgarian - bg
  • Mongolian - mn
  • Abaza - abq
  • Adyghe - ady
  • Kabardian - kbd
  • Avar - av
  • Dargwa - dar
  • Ingush - inh
  • Chechen - ce
  • Lak - lbe
  • Lezghian - lez
  • Tabasaran - tab
  • Kazakh - kk
  • Kyrgyz - ky
  • Tajik - tg
  • Macedonian - mk
  • Tatar - tt
  • Chuvash - cv
  • Bashkir - ba
  • Meadow Mari - mhr
  • Moldovan / Moldavian - mo
  • Udmurt - udm
  • Komi - kv
  • Ossetian - os
  • Buryat - bua
  • Kalmyk / Oirat - xal
  • Tuvan - tyv
  • Yakut / Sakha - sah
  • Karakalpak - kaa

Text orientation detection is not supported.

CJK

  • Simplified Chinese - zh
  • Traditional Chinese - zh-Hant
  • Japanese - ja
  • Korean - ko

Text orientation detection is not supported for Korean language.

Korean language can’t be mixed with the rest of the group.

Devanagari

  • Hindi - hi
  • Marathi - mr
  • Nepali - ne
  • Bihari - bh
  • Maithili - mai
  • Angika - anp
  • Bhojpuri - bho
  • Magahi - mag
  • Sadri / Nagpuri - sck
  • Newari / Nepal Bhasa - new
  • Konkani - gom
  • Sanskrit - sa
  • Bagri - bgc

Text orientation detection is not supported.

Arabic

  • Arabic - ar
  • Persian (Farsi) - fa
  • Uyghur - ug
  • Urdu - ur
  • Pashto - ps
  • Kurdish - ku
  • Sindhi - sd
  • Balochi - bal

Text orientation detection is not supported.

Other

  • Greek - el
  • Georgian - ka
  • Tamil - ta
  • Telugu - te
  • Thai - th

These languages can’t be mixed.

Mixing Languages

Note: You can include more than one language in the same document (for example, English + Arabic). The OCR engine can recognize mixed-language content as long as the selected languages are supported and follow the rules below.

Rules:

  • You can mix English with any other language.
  • You can mix languages that belong to the same script grouping, for example, you may mix any of the Latin languages.
  • Any other mixing of languages will result in an error.
  • Korean can only be mixed with English language.
  • Languages in the "Other" group can’t be mixed wit each other, and can only be mixed with English language.

Supported Languages (Alternative OCR)

  • English - eng
  • French - fra
  • German - deu
  • Italian - ita
  • Spanish - spa
  • Russian - rus

Supported Languages (IRIS OCR)

  • English - eng
  • French - fra
  • German - deu
  • Italian - ita
  • Spanish - spa
  • Russian - rus
  • Simplified Chinese - chi_sim
  • Traditional Chinese - chi_tra
  • Japanese - jpn
  • Korean - kor

Get started

OCR workflow
In this section, we showcase the potential OCR workflow.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales