Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Document OCR (Optical Character Recognition)

Security covered Under active development 32 sites

This module integrates with various OCR and AI services to extract text and data from image and PDF files. It can then map this extracted information to Drupal entities, offering features like translation, text-to-speech, and data transformation.

What is the Document OCR module?

The Document OCR module is an integration interface for the OCR services like Google Document AI to get contents of image and PDF files as text and if supported by the OCR service export text as properties. The module will map properties and import content into Drupal entities.

The module is extendable and supports many ways to transform data from files before saving into Drupal entities. By default the module comes with the Basic, Pipeline and the OpenAI transformer plugins.

Key Features

  • Integration with Google Document AI (with support for large PDF files via Google Cloud Storage).
  • Integration with Google Translation to translate extracted text.
  • Integration with Google Text to Speech to generate mp3 file based on the extracted text and attach mp3 to a file field.
  • Integration with PDF Parser PHP library.
  • Integration with Tesseract OCR engine.
  • Integration with PDFtoText (Poppler) engine.
  • Integration with docconv to extract text from PDF, DOC, DOCX, XML, HTML, RTF, ODT, PAGES files.
  • Integration with OpenAI to transcript audio files.
  • OpenAI integration support (get summaries for PDF files, translate content and many more options).
  • Integration with Microsoft Azure OpenAI using the same OpenAI plugins (see the README for the details).
  • Integration with Microsoft Azure Translation to translate extracted text.
  • Drupal entity and document properties mapping tool.
  • Transformer plugins to preprocess data before saving it into Drupal entities.
  • Pipeline transformer plugin allows to stack up multiple transformers and change their execution order.
  • One-time import tool.
  • Real-time processing and Queue processing.
  • Option to store API response as JSON.

Use Cases

The following are some use cases and can be extended via module's plugin system.

  • Process PDF files to extract its contents as text.
  • Process PDF file forms and extract each element as property using services like Google Document AI. It also allows to train extraction from your own custom forms.
  • Get summary of extracted PDF contents via OpenAI.
  • Create entities and have PDF file contents stored in Drupal.
  • Process receipts, tax forms and other documents.
  • Transcribe audio files and translate content to different languages via Google Translate transformer plugin or OpenAI.
  • Generate audio file (mp3) from the PDF extracted text via Google Text to Speech API.

Integration Modules

Configuration

Please read the README.md file for more details. It includes configuration details for the Google Document AI, OpenAI and other integrations.

Examples

Mapping listing page:

Mapping settings:

Drupal entity and document property mapping tool:

One-time import form (with the same Drupal entity and document property mapping tool)

Document processor listing page:

Add processor form:

Transformers listing page:

Basic property transformer plugin:

OpenAI property transformer plugin:

Document processing tasks listing page:

Installation

Use composer require 'drupal/document_ocr:^1.0' to install all required dependencies.

Drupal 9–11

Ask your assistant about Document OCR (Optical Character Recognition)

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
37
Tracked since
Jun 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0-alpha17 Pre-release 9–10 Jul 5, 2023
1.0.0-alpha16 Pre-release 9–10 Jul 4, 2023
1.0.0-alpha15 Pre-release 9–10 Jul 1, 2023
1.0.0-alpha14 Pre-release 9–10 Jun 25, 2023
1.0.0-alpha13 Pre-release 9–10 Jun 23, 2023
1.0.0-alpha12 Pre-release 9–10 Jun 21, 2023
1.0.0-alpha11 Pre-release 9–10 Jun 20, 2023
1.0.0-alpha10 Pre-release 9–10 Jun 19, 2023
1.0.0-alpha9 Pre-release 9–10 Jun 18, 2023
1.0.0-alpha8 Pre-release 9–10 Jun 16, 2023