File Content Extraction 26.1
Viewing SDK Programming Guide

# Draw a Page

## Draw a Page into a Supplied Device Context

- Use the VAPIMWP_DRAW_INIT parameter of the `VAPIM_DRAW` message to initialize the drawing routine in VAPI. You must send this parameter before you open the document by using the `VAPIMWP_INIT_OPEN_DOCUMENT` message.

- To get the number of pages in a document, open the document with the `bWait` parameter in the `TPVAPIOpenDocumentInfo` structure set to `TRUE`, and use the VAPIMWP_DRAW_GETPAGECOUNT parameter of the `VAPIM_DRAW` message. See VAPIMWP_INIT_OPEN_DOCUMENT for more information. You can set `bWait` to `FALSE` if you do not want to wait for the whole file to be processed and just want to get the size of the first few pages and draw the first few pages, or if you want to draw pages in any order.

  For spreadsheets, you must use the `VAPIMWP_DRAW_GETPAGECOUNT` parameter to draw the worksheet pages successfully. To change the worksheet, use the `VAPIM_MULTIOBJ` message. See VAPIMWP_MULTIOBJ_CANMULTIOBJ for more information.

- To get the size of the specified page, use the VAPIMWP_DRAW_GETPAGESIZE parameter of the `VAPIM_DRAW` message.

- To draw the specified page into the supplied device context, use the VAPIMWP_DRAW_DRAWPAGE parameter of the `VAPIM_DRAW` message.

- To create a thumbnail image file of a document page, use the VAPIMWP_DRAW_DRAWTOFILE parameter of the `VAPIM_DRAW` message.

Copyright 2016-2025 Open Text
Version 26.1 | Last updated January 2026

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: File Content Extraction 26.1

Topic Title: Draw a Page