nizarp / pdf-vision
Convert PDF file to text using Google Vision API
v1.1.1
2017-02-22 12:28 UTC
Requires
- php: >=5.5.0
- google/cloud: ^0.20.1
- predis/predis: ^1.1
- spatie/pdf-to-image: ~1.2
- vlucas/phpdotenv: ^2.4
Requires (Dev)
- phpunit/phpunit: ^5.2.0
- scrutinizer/ocular: ~1.1
This package is not auto-updated.
Last update: 2025-03-24 17:32:31 UTC
README
This package provides an easy to work with class to convert pdf's to text. It internally uses Google Cloud Vision API. You need to create an API key and add it to your project's .env
file as follows:
GOOGLE_VISION_PROJECTID=your-project-id
GOOGLE_APPLICATION_CREDENTIALS=/Path/To/Your/KeyFile.json
Read about Google Cloud Vision API
How to get service key
Google Cloud Vision API Document
Requirements
You should have Imagick and Ghostscript installed.
Install
The package can be installed via composer:
$ composer require nizarp/pdf-vision
Usage
Converting a pdf to text is easy.
$pdf = new Pdf($pathToPdf); $pdf->setEnvPath('/path/to/env/.env'); echo $pdf->convertToText();
Security
If you discover any security related issues, please email nizarp@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.