RecAPI
|
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 ( | |
#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. |
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.
enum FindTextAction |
RecProcessText flags.
These flags can be used for specifying which flags to be changed by RecProcessText.
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.
[in] | hDoc | The document handle. |
RECERR |
RECERR RecExecuteRedaction(IntPtr hDoc);
Frees the search data.
This function frees all internal data allocated for the given search. It must be called for all RecFindTextFirst calls.
[in] | hFt | Handle of the search. |
RECERR |
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.
[in] | hDoc | The document handle, created by RecOpenDoc. |
[in] | page | The page number where the finding starts from (zero-based index). (also see the position types). |
[in] | position | The letter index where the search should start inside the page (also see the position types). |
[in] | wordlist | NULL terminated LPCWSTR array for the words to search for. |
[in] | flags | Bitfield for search options, see the list of possible values. |
[in] | wordEnvLen | Word environment length: in addition to the found word, this many letters before and after the result will be returned in ft . |
[out] | hFt | Handle of the search, could be used in subsequent RecFindTextNext calls. |
[out] | ft | Information about the found word. |
RECERR | Returns REC_OK on successful search. If no match was found it returns APIP_NOMORE_WARN. Otherwise it returns an error code. |
hFt
must be closed with RecFindTextClose. This can be called even if there were no matches or in case of error. RECERR RecFindTextFirst(IntPtr hDoc, int page, int position, string[] wordlist, FindTextFlags flags, int wordEnvLen, out IntPtr hFt, out FoundText ft);
Gets the next search result.
This function continues the search using the given HFINDTEXT
.
[in] | hFt | Handle of the search. |
[out] | ft | Information about the found word. |
RECERR | Returns REC_OK on successful search. If no match was found it returns APIP_NOMORE_WARN. Otherwise it returns an error code. |
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
[in] | hFt | Handle of the search. |
[in] | ft | Text information about the current search result coming from a call of RecFindTextFirst or RecFindTextNext. |
[in] | flags | Which flag to change. |
[in] | set | To set or to unset the flag. |
RECERR |
RECERR RecProcessText(IntPtr hFt, [In] FoundText ft, FindTextAction flags, bool set);
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.
[in] | hFt | Handle of the search. |
[in,out] | ft | Text information about the current search result coming from a call of RecFindTextFirst or RecFindTextNext. |
RECERR |
RECERR RecRedactText(IntPtr hFt, [In, Out] FoundText ft);