Skip to content

IGR_Render_Page_Ex

IGR_Render_Page_Ex draws the page content into the specified output canvas

Prototype

IGR_LONG IGR_Render_Page_Ex(
    HPAGE Page,
    HCANVAS Canvas,
    IGR_UCS2* Options,
    const struct IGR_Render_Page_Properties* Properties,
    Error_Control_Block* Error);

Parameters

Page: HPAGE

Handle to a page, opened by a call to IGR_Open_Page.

Canvas: HCANVAS

Handle to a canvas, opened by a call to IGR_Make_Output_Canvas.

Options: Unicode string (UCS2)

Extended processing options used when converting the page. The Open Document Options are expressed as Name=Value with a semicolon delimiter.

Properties: Pointer to const IGR_Render_Page_Properties

Page specific render properties

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.

Additional information

Note The drawing API is available for bitmap and PDF outputs only. Drawing onto an HTML5 output is not supported.

Sample code

Error_Control_Block ISYSError;
IGR_LONG Capabilities, DocType, DocHandle, PageCount;
HPAGE PageHandle;
IGR_Render_Page_Properties RenderProperties;
RenderProperties.struct_size = sizeof(IGR_Render_Page_Properties);

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)
            {
                HCANVAS CanvasHandle;
                if (IGR_Make_Output_Canvas(IGR_DEVICE_IMAGE_PNG, L"page.png",
                    &CanvasHandle, &ISYSError) == IGR_OK)
                {
                    IGR_Render_Page_Ex(PageHandle, CanvasHandle,
                        UCS2("WATERMARK=EXAMPLE;GRAPHIC_EFFECT=GRAYSCALE"),
                        &RenderProperties , &ISYSError);
                    IGR_Close_Canvas(CanvasHandle, &ISYSError);
                }
                IGR_Close_Page(PageHandle, &ISYSError);
            }
        }
    }
    IGR_Close_File(DocHandle, &ISYSError);
}

See also