Tips For Success

Having the best tools for document imaging is only half of the equation. Our Tech Tips are designed to provide you with valuable information to help succeed by achieving faster results with RasterMaster SDKs or FlexSnap viewers. New time-saving tips are added monthly - you can receive them through Imaging News or our Tech Tips RSS feed.

Freeing the Buffer Allocation When Extracting Text

This Tech Tip first appeared in Imaging News July 2006.

Snowbound Software’s RasterMaster imaging SDK for Windows enables you to extract text from MS Word, MS Excel, PDF, AFP, and PCL files. This text is then available to be re-purposed for publishing, archiving, or searching. To extract text in the RasterMaster Imaging SDK for Windows, you can use the IMGLOW_extract_text() function.

After you extract the text and use it, you may no longer need it and may not want to save it. In this case, you’ll want to free up the buffer allocated by the IMGLOW_extract_text() function that you used to extract the text.

This tech tip describes how to free up the buffer allocated by the call to IMGLOW_extract_text().

 

if ( NULL != pReturndBuffer )

{

long temp = (long)GlobalHandle((HANDLE)pReturnedBuffer);

if ( temp )

{

GlobalUnlock((HANDLE)temp);

GlobalFree((HANDLE)temp);

}

pReturnedBuffer = NULL;

}