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.

asked 07 Jul '12, 07:33

Rather%20Wild's gravatar image

Rather Wild
1112

edited 01 Oct '12, 09:43

Vasily%20Panferov's gravatar image

Vasily Panferov ♦♦
5422516


I figured it out. I saved the response string to a file and used "fgets" to get each separate line of the file.

link

answered 11 Jul '12, 04:24

Rather%20Wild's gravatar image

Rather Wild
1112

Hi,

Can you post your code here? I am trying to do the same too

link

answered 28 Aug '12, 07:34

dan8833's gravatar image

dan8833
1114

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;

fwrite($fh, $stringData);

fclose($fh);

$file = fopen($myFile, "r") or exit("Unable to open file!");

//Output a line of the file until the end is reached

while(!feof($file))

{

echo fgets($file). "
"; }

fclose($file);

link

answered 28 Aug '12, 17:07

Rather%20Wild's gravatar image

Rather Wild
1112

thanks for the code

link

answered 04 Sep '12, 10:38

dan8833's gravatar image

dan8833
1114

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×33
×28
×27

Asked: 07 Jul '12, 07:33

Seen: 2,985 times

Last updated: 01 Oct '12, 09:43

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal