Draw a Page
Draw a Page into a Supplied Device Context
-
Use the VAPIMWP_DRAW_INIT parameter of the
VAPIM_DRAWmessage to initialize the drawing routine in VAPI. You must send this parameter before you open the document by using theVAPIMWP_INIT_OPEN_DOCUMENTmessage. -
To get the number of pages in a document, open the document with the
bWaitparameter in theTPVAPIOpenDocumentInfostructure set toTRUE, and use the VAPIMWP_DRAW_GETPAGECOUNT parameter of theVAPIM_DRAWmessage. See VAPIMWP_INIT_OPEN_DOCUMENT for more information. You can setbWaittoFALSEif 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_GETPAGECOUNTparameter to draw the worksheet pages successfully. To change the worksheet, use theVAPIM_MULTIOBJmessage. See VAPIMWP_MULTIOBJ_CANMULTIOBJ for more information. -
To get the size of the specified page, use the VAPIMWP_DRAW_GETPAGESIZE parameter of the
VAPIM_DRAWmessage. -
To draw the specified page into the supplied device context, use the VAPIMWP_DRAW_DRAWPAGE parameter of the
VAPIM_DRAWmessage. -
To create a thumbnail image file of a document page, use the VAPIMWP_DRAW_DRAWTOFILE parameter of the
VAPIM_DRAWmessage.