PHPackages                             nizarp/pdf-vision - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. nizarp/pdf-vision

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

nizarp/pdf-vision
=================

Convert PDF file to text using Google Vision API

v1.1.1(9y ago)2622[1 issues](https://github.com/nizarp/pdf-vision/issues)MITPHPPHP &gt;=5.5.0CI failing

Since Feb 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/nizarp/pdf-vision)[ Packagist](https://packagist.org/packages/nizarp/pdf-vision)[ RSS](/packages/nizarp-pdf-vision/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Convert a pdf file to text (OCR)
================================

[](#convert-a-pdf-file-to-text-ocr)

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](https://cloud.google.com/vision/)

How to get service key
----------------------

[](#how-to-get-service-key)

[Google Cloud Vision API Document](https://cloud.google.com/vision/docs/getting-started)

Requirements
------------

[](#requirements)

You should have [Imagick](http://php.net/manual/en/imagick.setresolution.php) and [Ghostscript](http://www.ghostscript.com/) installed.

Install
-------

[](#install)

The package can be installed via composer:

```
$ composer require nizarp/pdf-vision
```

Usage
-----

[](#usage)

Converting a pdf to text is easy.

```
$pdf = new Pdf($pathToPdf);
$pdf->setEnvPath('/path/to/env/.env');
echo $pdf->convertToText();
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

3

Last Release

3416d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24983?v=4)[Mohamed Nisar](/maintainers/nizarp)[@nizarp](https://github.com/nizarp)

---

Top Contributors

[![nizarp](https://avatars.githubusercontent.com/u/24983?v=4)](https://github.com/nizarp "nizarp (26 commits)")[![brlin-tw](https://avatars.githubusercontent.com/u/13408130?v=4)](https://github.com/brlin-tw "brlin-tw (1 commits)")

---

Tags

pdfconverttextnizarppdf-visiongoogle-cloud-vision

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nizarp-pdf-vision/health.svg)

```
[![Health](https://phpackages.com/badges/nizarp-pdf-vision/health.svg)](https://phpackages.com/packages/nizarp-pdf-vision)
```

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k36.7M149](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k40.5M265](/packages/smalot-pdfparser)[spatie/pdf-to-image

Convert a pdf to an image

1.5k16.5M96](/packages/spatie-pdf-to-image)[h4cc/wkhtmltopdf-amd64

Convert html to pdf using webkit (qtwebkit). Static linked linux binary for amd64 systems.

50725.6M39](/packages/h4cc-wkhtmltopdf-amd64)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3856.2M31](/packages/gotenberg-gotenberg-php)[kartik-v/yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

1693.3M36](/packages/kartik-v-yii2-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
