Transforming CLOUD-OCR-SDK XML Result for better readability

  • 67 Views
  • Last Post 14 March 2018
twiztedhadji posted this 07 March 2018

Hi. 

I have successfully received and stored the XML Response of a PDF Invoice to a BLOB stored in the DB. I can export the content to a XML File locally for further processing.

Now I need to be able to read the file and determine the Vendor / Supplier but as each letter is defined separately with it's own coordinates, this is making the task really difficult.

Before proceeding I would like to hear your thoughts / experiences on this matter. Is there anything anyone can share that would help me out?

FYI: 

Dynamics NAV 2017 is where the project is being developed. I have attached an example block with the name of the Vendor / Supplier

Attached Files

Oksana Serdyuk posted this 14 March 2018

If we speak about the xml export format for the processImage method, then the recognition result is described with the help of the following XML schema. The recognized text is presented in proper hierarchy: document > page > block > region > etc., not line by line. As the output includes the coordinates of each element, so you can parse the words by coordinates on your side and extract the necessary data from the output. The output provides each recognized character (even a space), therefore you do not need to split the words yourself. And when you need to find the words from one line, you should use the baseline coordinate of the words. If the baseline coordinates are close, the words are from the same line.

Close
We changed our Privacy Policy and Cookie Policy effective May 25, 2018. Click on the links to find out more.