IGR_Get_Page_Dimensions¶
IGR_Get_Page_Dimensions returns the size of the given page in pixels.
Prototype¶
IGR_LONG IGR_Get_Page_Dimensions(
HPAGE pageHandle,
IGR_LONG* width,
IGR_LONG* height,
Error_Control_Block* error);
Parameters¶
PageHandle: HPAGE
Handle to a page, opened by a call to IGR_Open_Page.
Width: Pointer to IGR_LONG
Returns the width of the page in pixels.
Height: Pointer to IGR_LONG
Returns the height of the page in pixels.
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, WordCount;
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)
{
IGR_LONG Width(0), Height(0);
IGR_Get_Page_Dimensions(PageHandle, &Width, &Height, &ISYSError);
}
}
}
IGR_Close_File(DocHandle, &ISYSError);
}