KeyView 24.4
KeyView Filter SDK C Programming Guide

# fpOpenDocumentFromFile()

Creates a `KVDocument` from a file.

The `KVDocument` type is an opaque pointer that represents a single document. You can pass the `KVDocument` into other functions in the Filter API to perform operations with that document.

## Syntax

    KVErrorCode (pascal* fpOpenDocumentFromFile)(
        KVFilterSession session,
        const char* szInputFile,
        KVDocument* ppDocument);

## Arguments

`session` | A KeyView Filter session that you initialized by calling fpInit().
`szInputFile` | A pointer to a string that contains the path of the file. On Windows, the path must be encoded in the local Windows code page.
`ppDocument` | A pointer to a `KVDocument`.

## Returns

The return value is an error code.

- If the call is successful, the return value is `KVError_Success` and the `KVDocument` is stored in `*ppDocument`.
- If the call is unsuccessful, the return value is an error code and `*ppDocument` is set to `NULL`.

## Discussion

- When you no longer need the `KVDocument`, call fpCloseDocument() to free the memory that was allocated by this function.
- The KeyView Filter session must outlive the `KVDocument` created by this function. In other words, you must call fpCloseDocument() on the `KVDocument` before calling fpShutdown() on the Filter session (`session`) that was used to create it.

## Example

The following example demonstrates the creation of a `KVDocument` from a file.

    KVDocument pDocument = NULL;
    error = fpOpenDocumentFromFile(session, szInputFile, &pDocument);

Copyright 1997-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: fpOpenDocumentFromFile()