Load Image from URL to Perform OCR in PHP

Aspose.OCR - Load Image from URL to Perform OCR

To Load Image from URL to Perform OCR using Aspose.OCR Java for PHP, simply invoke LoadImageFromUrl module. Here you can see example code.

PHP Code

## Initialize an instance of OcrEngine

$ocr_engine = new OcrEngine();

\# Set the Image property by loading the image from remote location

$imageStream=new ImageStream();

$ocr_engine->setImage($imageStream->fromUrl("http://cdn.aspose.com/tmp/ocr-sample.bmp"));

\# Process the image

if ($ocr_engine->process()) {

\# Display the recognized text

print "Text: " . (string)$ocr_engine->getText().PHP_EOL;

}

Download Running Code

Download Load Image from URL to Perform OCR (Aspose.OCR) from any of the below mentioned social coding sites: