For OCR PDF to text in PHP code, normally speaking you will buy some expensive software toolkits, library, which may cost more than 100 dollars. In this article, I will share a method of spending less than 20 dollars then you can OCR PDF to text in PHP code with better quality. The software I refer to here is named as VeryPDF OCR Cloud API, which belongs to VeryPDF cloud application family. VeryPDF Cloud API can be called from any platform and any program languages, include C#, VB.NET, ASP.NET, ASP, PHP, Java, Ruby, Amazon, etc. for file formats conversion, generation and others. Please check more related information of this software on homepage, in the following part, let us check how to use this software.
Step 1. Know how VeryPDF API works
- Different with other software application, you do not need to download anything from our website. So you do not need to worry system compatibility problem. It can work under all the system only where there is website connection.
- This is not freeware, if you need to use this software without any limitations like watermark, conversion page, please register an account and pay for it.
- This application charges per month like $19.95 / Month, for personal use. Please check more price list in Try and Buy website.
Step 2. OCR PDF to text from PHP code
- Here is a code example for your reference of calling this software from PHP code.
/* gets the data from a URL */
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
$returned_content = get_data('http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=ocr&infile=http://online.verypdf.com/examples/cloud-api/page.pdf&outfile=out&lang=eng');
By the above code template, we can OCR PDF in English to text. When you use this software, please change the API code to the real API code in your email box. Please change the input example PDF to the real PDF URL. Please add the language parameter at the end of the URL like above URL. Please change the language brief-code on introduction page.
By this application, you can also convert PDF to word, text and other editable file formats. And this software supports more than 50 OCR languages. Please check more information on homepage, during the using, if you have any question, please contact us as soon as possible.