IGR_Get_Page_Attribute¶
IGR_Get_Page_Attribute returns style or properties of an open page; see <page> under Structured XML for a full list of options.
Prototype¶
IGR_LONG IGR_Get_Page_Attribute(
HPAGE Page,
const IGR_UCS2* Name,
IGR_UCS2* Buffer,
IGR_LONG* BufferSize,
Error_Control_Block* ISYSError);
Parameters¶
Page: Handle to Page
The handle to a page that was opened using IGR_Open_Page.
Name: Unicode string (UCS2)
The name of the attribute to be extracted, see <page> under Structured XML for a full list of options.
Buffer: Unicode string (UCS2)
Application allocated memory block that will be filled with the next portion of text.
BufferSize: Pointer to IGR_LONG
Prior to the call: The size in Unicode (UCS2) characters of the buffer.
After the call: The actual number of Unicode (UCS2) characters extracted.
ISYSError: 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, PageHandle;
IGR_LONG RC = IGR_Open_File(_UCS2("TEST.DOC"), IGR_FORMAT_IMAGE, &Capabilities, &DocType, &DocHandle, &ISYSError);
if (RC == IGR_OK)
{
IGR_LONG PageCount;
if (IGR_Get_Page_Count(DocHandle, &PageCount, &ISYSError) == IGR_OK)
{
for (IGR_LONG I = i; i <= PageCount; i++)
{
if (IGR_Open_Page(DocHandle, i, &PageHandle, &ISYSError) == IGR_OK)
{
IGR_UCS2 Buffer[255];
IGR_LONG BufferSize = 254;
if (IGR_Get_Page_Attribute(PageHandle, _UCS2("SourceDpiX"), Buffer,
BufferSize, &ISYSError) == IGR_OK)
{
// - Buffer contains the value for SourceDpiX
}
IGR_Close_Page(PageHandle, &ISYSError);
}
}
}
}