codeguyakash / node_ocr

0 stars 0 forks source link

Certainly! Here is your README with the requested sections integrated:


Image to Word Document Converter

This Express.js application uses the Google Cloud Vision API to extract text from an uploaded image and converts it into a well-formatted Word document (.docx). The generated document preserves the formatting such as bold, italics, bullet points, and indentation based on the extracted text.

Features

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/webartsol/GoogleOCR.git
    cd GoogleOCR
  2. Install dependencies:

    npm install
  3. Run the application:

    npm run google

How to Obtain credentials.json for Google Cloud Vision API

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing project.
  3. Navigate to the API & Services > Credentials section.
  4. Click Create Credentials and choose Service Account.
  5. Fill in the required details and select the role Project > Editor.
  6. After creating the service account, go to Keys and click Add Key > Create New Key.
  7. Select JSON as the key type, and a file named credentials.json will be downloaded to your computer.
  8. Save this file in the root directory of your project.

Google Cloud Vision API Endpoint for OCR

To use Google Cloud Vision for Optical Character Recognition (OCR), the API endpoint is as follows:

This endpoint processes images to detect and extract text using the TEXT_DETECTION or DOCUMENT_TEXT_DETECTION features. To make requests, you must include your API key or authenticate with the credentials.json obtained earlier.

contact : codeguyakash@gmail.com