RecAPI
Text Marking and Redaction Module

Text Marking and Redaction. RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X. More...

Classes

struct  FoundText
 Search result. More...

Defines

#define FT_TEXTLEN   256
 Maximum possible search length.

Typedefs

typedef struct RECFT * HFINDTEXT
 Handle type for FindText functions.

Enumerations

enum  FindTextAction {
  FT_HIGHLIGHT,
  FT_STRIKEOUT,
  FT_MARKFORREDACT
}
 RecProcessText flags. More...

Functions

RECERR RECAPIPLS RecFindTextFirst (HDOC hDoc, int page, int position, LPCWSTR *wordlist, int flags, int wordEnvLen, HFINDTEXT *hFt, FoundText *ft)
 Starts the text search.
RECERR RECAPIPLS RecFindTextNext (HFINDTEXT hFt, FoundText *ft)
 Gets the next search result.
RECERR RECAPIPLS RecProcessText (HFINDTEXT hFt, FoundText *ft, FindTextAction flags, INTBOOL set)
 Marks the selection for redaction.
RECERR RECAPIPLS RecRedactText (HFINDTEXT hFt, FoundText *ft)
 Redacts the selection immmediately.
RECERR RECAPIPLS RecExecuteRedaction (HDOC hDoc)
 Performs redaction on all text strings previously marked for redaction.
RECERR RECAPIPLS RecFindTextClose (HFINDTEXT hFt)
 Frees the search data.

Position indices for RecFindTextFirst function

Special page and character index values. These values can be used in both the page index (page) and the character index (position) parameters of the RecFindTextFirst function.

#define FT_FIRST   0
 Specifies the first page or character.
#define FT_LAST   -1
 Specifies the last page or character.

RecFindTextFirst flags

Possible values for flags in RecFindTextFirst function (should be used as a bitmask).

#define FT_WHOLEWORD   1
 Finds only whole word match (character sequences starting and ending with whitespace or punctuation.
#define FT_MATCHCASE   2
 Match case sensitive.
#define FT_FUZZYMATCH   4
 Use fuzzy match (Accept matches with one insertion, deletion or change).
#define FT_BACKWARD   8
 Find backwards from the current position.

Detailed Description

Text Marking and Redaction. RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.

These functions make it possible to search for multiple strings simultaneously in a document. They also allow highlighting, striking out and redaction to be applied to the matches. They also support a batch redaction mode, where the matches are only marked for redaction first, and then the redaction can be performed in one step on all marked strings in the whole document. For more on redaction, see Chapter 2 (New Features) in the User's Guide.


Enumeration Type Documentation

RecProcessText flags.

These flags can be used for specifying which flags to be changed by RecProcessText.

Note:
Redaction replaces the characters in a dense set of gate characters to make them blacked out, and replaces the related content with a black rectangle on all variants of the image (II_ORIGINAL, II_CURRENT, II_BW and II_THUMBNAIL). Highlight and strikeout modify the text attributes, but do not modify the image. Therefore highlight and strikeout cannot be exported with image-on-text PDF.
Enumerator:
FT_HIGHLIGHT 

Places a yellow background behind the characters. Cannot be exported with Plain Text formatting.

FT_STRIKEOUT 

Strikes out the characters with a single line. Cannot be exported with Plain Text formatting.

FT_MARKFORREDACT 

Marks the characters for later redaction. Cannot be exported with Plain Text formatting.


Function Documentation

RECERR RECAPIPLS RecExecuteRedaction ( HDOC  hDoc)

Performs redaction on all text strings previously marked for redaction.

This function searches the document for all texts marked for redaction (see RecProcessText) and replaces the characters with a dense set of gate characters that result in a blacked out area, rendering the text unreadable. It also paints the place of all redacted text or objects on the image with black. This is done in all variants of the image - original, primary, BW, OCR. Redacted text becomes unreadable in all output file types, regardless of the formatting level.

Redaction cannot be undone, so it should normally be performed on a copy of the document. Certain warnings, such as these, should be passed to end-users if your application includes redaction. For guidance, see Chapter 2 (New Features) in the User's Guide.

Parameters:
[in]hDocThe document handle.
Return values:
RECERR
Note:
RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
The specification of this function in C# is:
 RECERR RecExecuteRedaction(IntPtr hDoc); 
RECERR RECAPIPLS RecFindTextClose ( HFINDTEXT  hFt)

Frees the search data.

This function frees all internal data allocated for the given search. It must be called for all RecFindTextFirst calls.

Parameters:
[in]hFtHandle of the search.
Return values:
RECERR
Note:
RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
The specification of this function in C# is:
 RECERR RecFindTextClose(IntPtr hFt); 
RECERR RECAPIPLS RecFindTextFirst ( HDOC  hDoc,
int  page,
int  position,
LPCWSTR *  wordlist,
int  flags,
int  wordEnvLen,
HFINDTEXT hFt,
FoundText ft 
)

Starts the text search.

This function starts a new search, it returns the allocated search handle and the first results if any.

Parameters:
[in]hDocThe document handle, created by RecOpenDoc.
[in]pageThe page number where the finding starts from (zero-based index). (also see the position types).
[in]positionThe letter index where the search should start inside the page (also see the position types).
[in]wordlistNULL terminated LPCWSTR array for the words to search for.
[in]flagsBitfield for search options, see the list of possible values.
[in]wordEnvLenWord environment length: in addition to the found word, this many letters before and after the result will be returned in ft.
[out]hFtHandle of the search, could be used in subsequent RecFindTextNext calls.
[out]ftInformation about the found word.
Return values:
RECERRReturns REC_OK on successful search. If no match was found it returns APIP_NOMORE_WARN. Otherwise it returns an error code.
Note:
RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
The returned hFt must be closed with RecFindTextClose. This can be called even if there were no matches or in case of error.
The specification of this function in C# is:
 RECERR RecFindTextFirst(IntPtr hDoc, int page, int position, string[] wordlist, FindTextFlags flags, int wordEnvLen, out IntPtr hFt, out FoundText ft); 
.
RECERR RECAPIPLS RecFindTextNext ( HFINDTEXT  hFt,
FoundText ft 
)

Gets the next search result.

This function continues the search using the given HFINDTEXT.

Parameters:
[in]hFtHandle of the search.
[out]ftInformation about the found word.
Return values:
RECERRReturns REC_OK on successful search. If no match was found it returns APIP_NOMORE_WARN. Otherwise it returns an error code.
Note:
RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
The specification of this function in C# is:
 RECERR RecFindTextNext(IntPtr hFt, out FoundText ft); 
RECERR RECAPIPLS RecProcessText ( HFINDTEXT  hFt,
FoundText ft,
FindTextAction  flags,
INTBOOL  set 
)

Marks the selection for redaction.

This function highlights, strikes out or marks for redacting (see RecExecuteRedaction) the match described by ft

Parameters:
[in]hFtHandle of the search.
[in]ftText information about the current search result coming from a call of RecFindTextFirst or RecFindTextNext.
[in]flagsWhich flag to change.
[in]setTo set or to unset the flag.
Return values:
RECERR
Note:
RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
The specification of this function in C# is:
 RECERR RecProcessText(IntPtr hFt, [In] FoundText ft, FindTextAction flags, bool set); 
RECERR RECAPIPLS RecRedactText ( HFINDTEXT  hFt,
FoundText ft 
)

Redacts the selection immmediately.

This function replaces the matched characters in ft with a dense set of gate characters to make them blacked out, and replaces the related content with a black rectangle on all variants of the image. For details see RecExecuteRedaction.

Parameters:
[in]hFtHandle of the search.
[in,out]ftText information about the current search result coming from a call of RecFindTextFirst or RecFindTextNext.
Return values:
RECERR
Note:
RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
The specification of this function in C# is:
 RECERR RecRedactText(IntPtr hFt, [In, Out] FoundText ft);