KeyView 24.4
KeyView Viewing SDK Programming Guide

# Open and View a Document

Because a document must be opened before it can be viewed, printed, saved, or can have any other operation performed on it, viewing a document in the Viewing API means to open and view a document. It is possible, however, to open a document without viewing it, or in other words, to open a document with view mode disabled. In this mode, you can print or save the document without viewing it.

To open a document

1. Create a TPVAPIOpenDocumentInfo structure.

   To open a document without viewing it (view mode disabled), set the `VAPIDF_FLAGS_OPEN_WITHOUT_VIEW` flag in the `nFlags` member of the `TPVAPIOpenDocumentInfo` structure.

2. Send VAPI a `VAPIM_INIT` message with the `wParam` set to `VAPIMWP_INIT_OPEN_DOCUMENT`, and the `lParam` set to the address of the `TPVAPIOpenDocumentInfo` structure. See VAPIMWP_INIT_OPEN_DOCUMENT.

   For example:

       memset (&OpenDocInfo, 0, sizeof(TPVAPIOpenDocumentInfo));
       OpenDocInfo.lpszFilePath = szFileName;
       lResult = SendMessage (hWndVAPI, VAPIM_INIT, VAPIMWP_INIT_OPEN_DOCUMENT, (LPARAM)OpenDocInfo);

## Notification Messages

- To receive the status of the open document expressed as the percent done, wait for the VAPINMWP_INIT_OPENDOCDONE notification message.

- To receive the current page number of the document, wait for the VAPINMWP_INIT_PAGENUMBER notification message.

- To receive the name of the current object of the document, wait for the VAPINMWP_MULTIOBJ_OBJNAME notification message.

Copyright 2016-2024 Open Text
Version 24.4 | Last updated September 2024

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: IDOL KeyView 24.4

Topic Title: Open and View a Document