fpFilter()

Filters text from a document.

Syntax

KVErrorCode (pascal* fpFilter)(
    KVDocument pDocument,
    KVFilterOutput* pFilterOutput);

Arguments

pDocument

A KVDocument that you created with fpOpenDocumentFromFile() or fpOpenDocumentFromStream().

pFilterOutput A pointer to a KVFilterOutput structure. This structure defines the output buffer.

Returns

The return value is an error code.

  • If the call is successful, the return value is KVError_Success and the filtered text is stored in pFilterOutput.
  • If the call is unsuccessful, the return value is an error code that indicates the problem.

Discussion

  • This function outputs filtered text in chunks. The first call to fpFilter() outputs the first chunk of filtered text to pFilterOutput. Call fpFilter() again to output the next chunk, and repeat this process to obtain all of the filtered text from the document. The final chunk does not contain any text, such that pFilterOutput->cbText == 0. Do not call fpFilter() again after this.

    IMPORTANT: Do not call any Filter API functions between calls to fpFilter(), because doing so might prevent filtering from resuming correctly.

  • After each call to fpFilter, when you no longer require the data in the pFilterOutput structure, call fpFreeFilterOutput to free the memory allocated by this function.
  • This function runs in process or out of process. See The Filter Process Model.