IGR_Open_Page¶
IGR_Open_Page gives access to page specific content for documents opened using the IGR_FORMAT_IMAGE flag, including page words, images, and structured XML.
Prototype¶
IGR_LONG IGR_Open_Page(
IGR_LONG DocHandle,
IGR_LONG PageIndex,
HPAGE* PageHandle,
Error_Control_Block* error);
Parameters¶
DocHandle: IGR_LONG
Handle to a document, opened by a call to IGR_Open_File, IGR_Open_File_Ex, IGR_Open_Stream or IGR_Open_Stream_Ex.
PageIndex: IGR_LONG
0-based page number to the page to open.
PageHandle: Pointer to HPAGE
Returns a handle to be used in subsequent page calls.
Error: Pointer to Error_Control_Block
Returns error details if the call fails.
Return value¶
Success: IGR_LONG
Returns IGR_OK.
Failure: IGR_LONG
Returns one of the possible IGR_E error codes.
Sample code¶
Error_Control_Block ISYSError;
IGR_LONG Capabilities, DocType, DocHandle, PageCount;
HPAGE PageHandle;
IGR_LONG RC = IGR_Open_Stream(pStream, IGR_FORMAT_IMAGE, &Capabilities, &DocType, &DocHandle, &ISYSError);
if (RC == IGR_OK)
{
if (IGR_Get_Page_Count(DocHandle, &PageCount, &ISYSError) == IGR_OK)
{
for (IGR_LONG PageIndex = 0; PageIndex < PageCount; PageIndex++)
{
if (IGR_Open_Page(DocHandle, PageIndex, &PageHandle, &ISYSError) == IGR_OK)
{
// Process Page Element
IGR_Close_Page(PageHandle, &ISYSError);
}
}
}
IGR_Close_File(DocHandle, &ISYSError);
}
Additional information¶
The call will load resources associated with the page that can then be used in calls to IGR_Get_Page_Word_Count, IGR_Get_Page_Words, IGR_Get_Page_Dimensions, IGR_Get_Page_Text, and IGR_Render_Page.
The application must call IGR_Close_Page when finished using the page. All pages must be closed before calling IGR_Close_File.