Skip to main content

Get-Text-of-Each-Line

Command Description

Get all text by row in Text OCR

Command Prototype

arrayRet = Mage.ExtractLineText(jsonRet)

Parameter Description

ParameterRequiredTypeDefaultDescription
jsonRetTrueexpressionjsonRetOutput variables from "Screen Text OCR", "Image Text OCR", "PDF Text OCR"

return

arrayRet,The variable used to save the output of the command.

Demo

Dim jsonRet = {"ai_function" : "ocr_text","items" : [{"char_positions" : [],"content" : "Pass the page number specified by the PDF through  Laiye  Intelligent Document Processing General text recognition, the recognition result returns JSON format","handwrite_info" : null,"importance_info" : null,"page_number" : 1,"positions" : [{" x" : 71,"y" : 60},{"x" : 522,"y" : 61},{"x" : 522,"y" : 75 },{"x" : 71,"y" : 74}],"probabilities" : []},{"char_positions" : [],"content" : ". In the process of identifying multiple pages, if one of the pages fails, the entire identification will return an error, and the quota will be consumed","handwrite_info" : null,"importance_info" : null,"page_number" : 1,"positions " : [{"x" : 72,"y" : 76},{"x" : 420,"y" : 76},{"x" : 420, "y" : 89},{"x" : 72,"y" : 89}],"probabilities" : []}],"struct_content" : {"page"  : [{"content" : "Recognize the page number specified by PDF through  Laiye Intelligent Document Processing  general text, and return the recognition result in JSON format. In the process of recognizing multiple pages, if one of the pages fails, the entire recognition will be performed. An error will be returned and the quota will be consumed","page_id" : 0,"page_number" : 1}],"paragraph" : [{"content" : "Pass the page number specified by the PDF through   Laiye Intelligent Document Processing General text recognition, the recognition result is returned in JSON format. In the process of recognizing multiple pages, if one of the pages fails, the entire recognition will return an error, and the quota will be consumed","page_number" : 1, "paragraph_id" : 0}],"row" : [{"content" : "Pass the page number specified by PDF through  La iye Intelligent Document Processing General text recognition, the recognition result returns JSON format ","page_number" : 1,"row_id" : 0},{"content" : ". In the process of identifying multiple pages, if one of the pages fails, the entire identification will return an error, and the quota will be consumed","page_number" : 1,"row_id" : 1}]}}  // Test data 

TracePrint "--------------------Get each line of text--------------------"
// --------------------------------------------------------
// [Remarks] Get each line of text
// Input parameters:
// jsonRet--Use "screen text recognition", "image text recognition", "PDF text recognition" command output to the variable

// Output parameters:
// arrayRet: The variable to which the output of the function call is saved

// Command prototype: arrayRet = Mage.ExtractLineText(jsonRet)
// --------------------------------------------------------

arrayRet = Mage.ExtractLineText(jsonRet)
TracePrint(arrayRet)