ImageGear for C and C++ on Windows v19.10 - Updated
IG_REC_document_write
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Formatted Output Functions > IG_REC_document_write

Writes a document to the specified file according to the current conversion settings.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_document_write(
   HIG_REC_DOCUMENT hDocument,
   const LPSTR lpOutputFileName
);

Arguments:

Name Type Description
hDocument HIG_REC_DOCUMENT Document handle.
lpOutputFileName const LPSTR Path to the file to which to save the document.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

See IG_REC_image_import.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
HIGEAR higImage = 0;
HIG_REC_IMAGE higRecImage = 0;
HIG_REC_DOCUMENT hRecDocument = 0;

ErrCount += IG_load_file("Image.tif", &higImage);
ErrCount += IG_REC_image_import(higImage, &higRecImage);
ErrCount += IG_REC_image_recognize(higRecImage);
ErrCount += IG_REC_document_create(NULL, &hRecDocument);
ErrCount += IG_REC_document_page_insert(hRecDocument, higRecImage, -1);
ErrCount += IG_REC_output_codepage_set("Windows ANSI");
ErrCount += IG_REC_output_format_set("Converters.Text.XML");
ErrCount += IG_REC_document_write(hRecDocument, "output.xml");

//...

ErrCount += IG_REC_document_close(hRecDocument);
ErrCount += IG_image_delete(higImage);

Remarks:

Use IG_REC_output_format_get or IG_REC_output_format_set to get or set the output format.

See Also

HIG_REC_DOCUMENT