FoxitPDFSDKforWeb
v10.0.0
Foxit PDF SDK for Web
|
Provides APIs to find or replace text in the PDF document. More...
Inherits UIXAddon.
Public Member Functions | |
activate () | |
Activate find and replace function. More... | |
clearCache () | |
Call this function to clear the cache before each new find or replace operation. More... | |
deactivate () | |
Deactivate find and replace function. Must be called after activate. More... | |
async | find (find, options) |
Find text. More... | |
async | replace (find, replace, options) |
Replace text. It will do find first, then replace. More... | |
async | replaceAll (find, replace, options) |
Replace all text. It will do find first, then replace. More... | |
setNeedToReplace (callback) | |
A callback function to verify whether need to replace the text. It works on [replace]FindReplaceAddon#replace and [replaceAll]FindReplaceAddon#replaceAll API. More... | |
Provides APIs to find or replace text in the PDF document.
|
inline |
Activate find and replace function.
|
inline |
Call this function to clear the cache before each new find or replace operation.
|
inline |
Deactivate find and replace function. Must be called after activate.
|
inline |
Find text.
find | string - Text to find. |
[options] | Object - Options for finding. |
[options.pageRange] | Array - Specifies page index range, like: [startIndex: number, endIndex: number]. Default is all pages. The valid page range: from 0 to count - 1. count is the total number of pages. |
[options.wholeWords=false] | boolean - Whether to match whole words. |
[options.caseSensitive=false] | boolean - Whether to match case sensitive. |
[options.isReversed=false] | boolean - Whether to search in reversed order. |
|
inline |
Replace text. It will do find first, then replace.
find | string - Text to find. |
replace | string - Text to replace. |
[options] | Object - Options for finding. |
[options.pageRange] | Array - Specifies page index range, like: [startIndex: number, endIndex: number]. Default is all pages. The valid page range: from 0 to count - 1. count is the total number of pages. |
[options.wholeWords=false] | boolean - Whether to match whole words. |
[options.caseSensitive=false] | boolean - Whether to match case sensitive. |
[options.isReversed=false] | boolean - Whether to search in reversed order. |
|
inline |
Replace all text. It will do find first, then replace.
find | string - Text to find. |
replace | string - Text to replace. |
[options] | Object - Options for finding. |
[options.pageRange] | Array - Specifies page index range, like: [startIndex: number, endIndex: number]. Default is all pages. The valid page range: from 0 to count - 1. count is the total number of pages. |
[options.wholeWords=false] | boolean - Whether to match whole words. |
[options.caseSensitive=false] | boolean - Whether to match case sensitive. |
|
inline |
A callback function to verify whether need to replace the text. It works on [replace]FindReplaceAddon#replace and [replaceAll]FindReplaceAddon#replaceAll API.
callback | (find: string, replace: string, pageIndex: number, rectArray: Array<{left: number; right: number; top: number; bottom: number}>) => Promise<boolean> - The callback function will be called when a match is found. If the callback function returns true, the text will be replaced. If the callback function returns false, the text will not be replaced. Parameter rectArray is PDF coordinates of the matched text. |