10 August 2018
- Last edited 10 August 2018
If you are processing well-structured documents with fixed layout (i.e. positions of fields do not change from one document to another), it is better practice to use the processFields method. The method starts the processing task with the parameters of processing described in a special XML file. This XML file should be transmitted in the request body. You can use the XSD schema of the XML file to create the file with necessary settings. Please see also the description of the tags and several examples of XML files with settings in XML Parameters of Field Recognition.
Please note that using the processFields method you should specify coordinates of each field should be processed. Pay your attention that the coordinates of each field should be specified relative to the left top corner of the image in the following order: left, top, right, bottom. It means the following:
left – x coordinate of the top pixel of the field,
top - y coordinate of the top pixel of the field,
right - x coordinate of the bottom pixel of the field,
bottom - y coordinate of the bottom pixel of the field.
The left, top, right and bottom coordinates are rectangle border locations in pixel. For example, on the picture below the coordinate of top left corner of the image block is (20, 143), which means that the left coordinate of the image is 20, the top coordinate is 143.
On the other hand, if your documents have flexible layout (coordinates of fields may differ in different documents), you may try to export the source document to the XML format with the help of the processImage method. Then you could parse the output XML on your side and extract the coordinates of each block for further processing. Please see the Output XML Document article for the detailed description of the XML output.
You can find some our standard code samples demonstrating implementation of some general scenarios on the Code Samples web page.
Hope this information will be helpful!