ocrmypdf command not found

In this troubleshooting guide we learn how to fix ocrmypdf command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

ocrmypdf: command not found

or when using sudo you get the following error message

sudo: ocrmypdf: command not found

Solutions to ocrmypdf: command not found

How To Fix ocrmypdf: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu ocrmypdf is provided by ocrmypdf package.

ocrmypdf is:

OCRmyPDF generates a searchable PDF/A file from a regular PDF containing only images, allowing it to be searched.

It uses the Tesseract OCR engine and so supports all the languages that Tesseract does.

Some other main features:

  • Places OCR text accurately below the image to ease copy / paste
  • Keeps the exact resolution of the original embedded images
  • When possible, inserts OCR information as a lossless operation without rendering vector information
  • Keeps file size about the same
  • If requested deskews and/or cleans the image before performing OCR
  • Validates input and output files
  • Provides debug mode to enable easy verification of the OCR results
  • Processes pages in parallel when more than one CPU core is available
  • Battle-tested on thousands of PDFs, a test suite and continuous integration.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ocrmypdf

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ocrmypdf.

sudo apt -y install ocrmypdf

Or if you have aptitude installed you can use the following command.

sudo aptitude install ocrmypdf

Summary

In this tutorial we learn how to fix ocrmypdf command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.