Hi, I love the new processTextField function you guys have added. It is exactaly what I need!! I am however struggling to get the call working. Using Android I have the following code that submits one text field

public Task  processTextField( String filePath, ProcessingSettings settings) throws Exception
    URL url = new URL("http://cloud.ocrsdk.com/processTextField?" + settings.AsUrlParams());
    byte[] fileContents = readDataFromFile( filePath );
    HttpURLConnection connection = openPostConnection(url);
    connection.setRequestProperty("Content-Length", Integer.toString(fileContents.length));
    connection.getOutputStream().write( fileContents );
    BufferedReader reader = new BufferedReader( new InputStreamReader( connection.getInputStream()));
    return new Task(reader);

settings.AsUrlParams() return the string "language=English&textType=handprinted&oneTextLine=true&oneWordPerTextLine=true&markingType=underlinedText", and filePath is the path to my JPEG file.

Would it be possible to get a code example of how to post the XML file you speak of here (http://ocrsdk.com/documentation/specifications/xml-scheme-field-settings) in Java? So for example you have an image and there are 2 or 3 text fields you want to submit at once.

Thanks Al

asked 26 May '12, 19:22

dale's gravatar image


edited 08 Apr '15, 13:18

Vitalik%20Kudryavcev's gravatar image

Vitalik Kudr... ♦♦

Current Java sample is able to call processFields. Try it and see source code for more details.

Sample xml is available when you download the whole sample archive from github.


answered 28 May '12, 10:08

Vasily%20Panferov's gravatar image

Vasily Panferov ♦♦

edited 09 Jun '12, 11:22

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 26 May '12, 19:22

Seen: 2,429 times

Last updated: 08 Apr '15, 13:18

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