I was wondering if there is a way return line breaks with "exportFormat=txt" (PHP) or any other way to return each line of text on the image as a separate line and/or variable? Rich Text Format returns too much text formatting for my use.
Line break PHP
- 3.1K Views
- Last Post 04 September 2012
I figured it out. I saved the response string to a file and used "fgets" to get each separate line of the file.
Here's the code I added to the ABBYY PHP example:
$file_name = "ocr_file"; //whatever you want to name the file(I auto generate a unique name)
$myFile = "directory of where you want to save the file/".$file_name.".txt";
//write the file
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $response;
$file = fopen($myFile, "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
echo fgets($file). "
1351 questions, 4403 answers.