Foxit PDF SDK
|
Instance Methods | |
(BOOL) | - findNext |
Search for next matched pattern. More... | |
(BOOL) | - findPrev |
Search for previous matched pattern. More... | |
(int) | - getMatchEndCharIndex |
Get the index of the last character of current match pattern, based on current match page. More... | |
(int) | - getMatchPageIndex |
Get the page index, to which current match belongs. More... | |
(FSRectFArray *) | - getMatchRects |
Get the rectangles of current match pattern. More... | |
(NSString *) | - getMatchSentence |
Get the sentence that contains current match pattern. More... | |
(int) | - getMatchSentenceStartIndex |
Get the index of the first character of current match pattern, based on the match sentence. More... | |
(int) | - getMatchStartCharIndex |
Get the index of the first character of current match pattern, based on current match page. More... | |
(id) | - initWithAnnot: |
Constructor, for a specified PDF annotation. More... | |
(id) | - initWithDocument:cancel: |
Constructor, for a PDF document. More... | |
(id) | - initWithOther: |
Constructor, with another text search object. More... | |
(id) | - initWithText_page: |
Constructor, for a specified text page. More... | |
(id) | - initWithXfa_document:cancel: |
Constructor, for a specified XFA document. More... | |
(BOOL) | - isEmpty |
Check whether current object is empty or not. More... | |
(BOOL) | - setEndPage: |
Set ending page index. More... | |
(BOOL) | - setPattern: |
Set keywords to search. More... | |
(BOOL) | - setSearchFlags: |
Set search flags. More... | |
(BOOL) | - setStartPage: |
Set starting page index. More... | |
This class can construct text search in a PDF document/an XFA document/a text page or in a PDF annotation's appearance. It offers functions to do a text search and get the searching result:
- (BOOL) findNext |
Search for next matched pattern.
- (BOOL) findPrev |
Search for previous matched pattern.
- (int) getMatchEndCharIndex |
Get the index of the last character of current match pattern, based on current match page.
- (int) getMatchPageIndex |
Get the page index, to which current match belongs.
This function can only be used for a text search in PDF document or in XFA document.
- (FSRectFArray *) getMatchRects |
Get the rectangles of current match pattern.
- (NSString *) getMatchSentence |
Get the sentence that contains current match pattern.
- (int) getMatchSentenceStartIndex |
Get the index of the first character of current match pattern, based on the match sentence.
In a sentence, there may be more than 2 match patterns. This function can help to confirm which pattern in the sentence is just current match pattern.
- (int) getMatchStartCharIndex |
Get the index of the first character of current match pattern, based on current match page.
- (id) initWithAnnot: | (FSAnnot*) | annot |
Constructor, for a specified PDF annotation.
Currently, only support to search in appearance of following annotation types: free text annotation, stamp annotation, widget annotation, stamp annotation, and line annotation.
[in] | annot | A valid annotation object. |
- (id) initWithDocument: | (FSPDFDoc*) | document | |
cancel: | (id<FSSearchCancelCallback>) | cancel | |
Constructor, for a PDF document.
User can set a valid object in order to decide whether to cancel the searching process or not when the callback function in SearchCancelCallback is triggered.
[in] | document | A valid PDF document object. |
[in] | cancel | A object which decides if the searching process needs to be canceled when the callback function is triggered. This can be nil which means not to cancel the searching process. If this is not nil, it should be a valid object implemented by user. |
- (id) initWithOther: | (FSTextSearch*) | other |
Constructor, with another text search object.
[in] | other | Another text search object. |
- (id) initWithText_page: | (FSTextPage*) | text_page |
Constructor, for a specified text page.
[in] | text_page | A text page object. |
- (id) initWithXfa_document: | (FSXFADoc*) | xfa_document | |
cancel: | (id<FSSearchCancelCallback>) | cancel | |
Constructor, for a specified XFA document.
[in] | xfa_document | A valid XFA document object. It should have been loaded by function FSXFADoc::startLoad:. |
[in] | cancel | A object which decides if the searching process needs to be canceled when the callback function is triggered. This can be nil which means not to cancel the searching process. If this is not nil, it should be a valid object implemented by user. |
- (BOOL) isEmpty |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
- (BOOL) setEndPage: | (int) | page_index |
Set ending page index.
This function can only be used for a text search object which is constructed with FSPDFDoc object or FSXFADoc object. For other case, this function will throw exception FSErrUnsupported.
If this function is not called, default value count-1 will be used as the ending page index.
[in] | page_index | Index of the page, from which the search ended. Valid range: from 0 to (count-1). count is returned by function FSPDFDoc::getPageCount for PDF document or by function FSXFADoc::getPageCount for XFA document. |
- (BOOL) setPattern: | (NSString *) | key_words |
Set keywords to search.
[in] | key_words | The text content to be searched. It should not be an empty string. |
- (BOOL) setSearchFlags: | (unsigned int) | search_flags |
Set search flags.
If this function is not called, default value FSTextSearchSearchNormal will be used.
[in] | search_flags | Search flags. Please refer to values starting from FSTextSearchSearchNormal and this can be one or combination of these values. |
- (BOOL) setStartPage: | (int) | page_index |
Set starting page index.
This function can only be used for a text search object which is constructed with FSPDFDoc object or FSXFADoc object. For other case, this function will throw exception FSErrUnsupported.
If this function is not called, default value 0 will be used as the starting page index.
[in] | page_index | Index of the page, from which the search starts. Valid range: from 0 to (count-1). count is returned by function FSPDFDoc::getPageCount for PDF document or by function FSXFADoc::getPageCount for XFA document. |