ImageGear for C and C++ on Windows v19.1 - Updated
Export to Text Formats
User Guide > How to Work with... > OCR > How to... > Assess and Analyze OCR Output > Export to Text Formats

ImageGear Recognition API allows saving recognized data to a number of simple text and XML formats. Use IG_REC_output_direct_text_write function to write recognized data of several HIG_REC_IMAGE objects to a simple text or XML file. Use IG_REC_output_text_format_get/IG_REC_output_text_format_set functions to get or set the format for saving. The following formats are available:

The following example loads an image file, recognizes it, and outputs it as formatted text.

Saving the Recognized Data Directly in the Text Format

C
Copy Code
AT_ERRCOUNT nErrCount;
HIGEAR hIGear;
HIG_REC_IMAGE hImg;
nErrCount = IG_load_file("Image.tif", &hIGear );
nErrCount = IG_REC_image_import(hIGear, &hImg);
nErrCount = IG_image_delete(hIGear);
nErrCount = IG_REC_image_recognize(hImg);
nErrCount = IG_REC_output_codepage_set("Windows ANSI");
nErrCount = IG_REC_output_text_format_set(IG_REC_DTXT_TXTF);
nErrCount = IG_REC_output_direct_text_write(&hImg, 1, "ONEPAGE.txt");
//...
nErrCount = IG_REC_image_delete(hImg);