vluzrmos / ocrwebservice
A wrapper for ocrwebservice.com
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 1
Open Issues: 0
pkg:composer/vluzrmos/ocrwebservice
Requires
- guzzlehttp/guzzle: ~5.3|~6.0
This package is auto-updated.
Last update: 2025-09-13 07:50:55 UTC
README
This package is a wrapper for http://www.ocrwebservice.com/api/restguide.
Installation
composer require vluzrmos/ocrwebservice
Usage
You should have an account with a trial or other subscription plan to use that package.
Getting Account Information
/* * USERNAME and LICENSE_KEY are strings, and both are provided by ocrwebservice.com. */ $ocr = new OCRWebService\OCRWebService(USERNAME, LICENSE_KEY); $account = $ocr->getAccountInformation(); /* Returns an object AccountInformation which has a method ->toArray(): [ "AvailablePages" => 22, "MaxPages" => 25, "ExpirationDate" => "04/29/2016", "LastProcessingTime" => "3/29/2016 10:42:13 AM", "SubcriptionPlan" => "TRIAL", "ErrorMessage" => "", ] */ $account->getAvailablePages(); $account->getMaxPages(); //... $account->availablePages; //same of getAvailablePages() method; //...
Processing a Document
/* * USERNAME and LICENSE_KEY are strings, and both are provided by ocrwebservice.com. */ $ocr = new OCRWebService\OCRWebService(USERNAME, LICENSE_KEY); $document = $ocr->processDocument($pathToPdfOrImage, [ 'gettext' => 'true', 'pagerange' => 'allpages', 'language' => 'brazilian' ]); //all options like described in http://www.ocrwebservice.com/api/restguide // $document will be an instance of ProcessDocument, with that following methods: $document->getOCRText(); //return ocr $document->toArray(); //return an array with all data //...