Product: Android Apryse SDK
Product Version: 10.6.0
Please give a brief summary of your issue: Regarding search
(Think of this as an email subject)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
I have a PDF URI and a Search word with me. If the search word is present in the 4th page of the pdf file, the Apryse sdk should open the 4th page directly using the URI and highlight the search word. Could you please help me providing with the necessary Android kotlin code.
Note: I am currently using âPdfViewCtrlTabHostFragment2â to open a pdf document.
Please provide a link to a minimal sample where the issue is reproducible:
1 Like
Thank you for posting your question to our forum. We will provide you with an update as soon as possible.
1 Like
You can try searching for your word in the document using the PdfViewCtrlTabFragment2.queryTextSubmit(String)
API. You will need to call the API after the document has loaded as follows:
mPdfViewCtrlTabHostFragment = ViewerBuilder2.withUri(uri)
.usingConfig(viewerConfig)
.usingTheme(R.style.MyCustomAppTheme)
.build(this);
mPdfViewCtrlTabHostFragment.addHostListener(new PdfViewCtrlTabHostFragment2.TabHostListener() {
@Override
public void onTabDocumentLoaded(String tag) {
if (mPdfViewCtrlTabHostFragment != null) {
PdfViewCtrlTabFragment2 currentPdfViewCtrlFragment = mPdfViewCtrlTabHostFragment.getCurrentPdfViewCtrlFragment();
if (currentPdfViewCtrlFragment != null) {
currentPdfViewCtrlFragment.queryTextSubmit("My Search Text");
}
}
}
...
2 Likes