This is driving me nuts and I hope someone can help me. What I did so far using PHP/curl: I upload an image using the submitImage method. The call is successful (200) and returns a taskId. I then try to use processFields to recognize textareas in the image. The code looks like this.
The fields.xml looks like this.
The call to processFields returns an error 450 with the error message "Data at the root level is invalid. Line 1, position 1." According to the documentation this indicates:
The taskId is correct (1), and the task shouldn't have been already started (3) since I get a new identifier every time I run my script. I do not use a description (4). This leaves me, most likely, with an incorrect XML.
I tried to omit "<?xml version="1.0" encoding="utf-8"?>" but still get a 450 with 'data at the root level is invalid'. I removed the regExp, still 450. I changed the encoding from UTF-8 to Latin1, still 450. I changed the line endings form CRLF to LF, still 450. I changed <page applyto="0"> to just <page>, still 450.
Searching this forum for "data root level" and alike yielded no results at all. Anyone out there, who can help me?
Many thanks in advance! Hans
asked 20 Mar '14, 12:28
The solution is to replace "applyto" to "applyTo".
Ready XML samples can always be found here: http://ocrsdk.com/documentation/specifications/xml-scheme-field-settings/
answered 20 Mar '14, 14:47
Anastasia Ga... ♦♦
Just to double-check, I used the short example given under the URL http://ocrsdk.com/documentation/specifications/xml-scheme-field-settings/ "as is"
With the same very same error message result. I must be doing something wrong.
It would be extremely helpful if there was a working PHP example using processFields. Is such code available?
answered 20 Mar '14, 19:09