node-pdf-ocr

1.0.0-main • Public • Published

Installation

npm i node-pdf-ocr

Install Tesseract from GitHub

Install Ghostscript from GitHub

Edit .env file and set the following variables:

TESSERACT_PATH = /path/to/tesseract/tessdata
GHOSTSCRIPT_PATH = /path/to/ghostscript

Note: You may remove GHOSTSCRIPT_PATH if you have installed Ghostscript on your system and added it to PATH.

Usage

require('dotenv').config();                           // To load executable paths from .env file
const PdfOcr = require('node-pdf-ocr');

PdfOcr('/path/to/pdf/file.pdf')
  .then((text) => console.log(text))
  .catch((err) => console.error(err));

License

MIT License

Made by JAGUARAVI

/node-pdf-ocr/

    Package Sidebar

    Install

    npm i node-pdf-ocr

    Weekly Downloads

    7

    Version

    1.0.0-main

    License

    ISC

    Unpacked Size

    6.56 kB

    Total Files

    8

    Last publish

    Collaborators

    • jaguar_avi