How to open text highlight on my button click?


Product Version:9.0.1

I am trying to create an app in which i can call text highlight annotation of pdftron from my button click.
so how can i do that ? to view pdf i am using PDFViewCtrl.

Lets take one button on clicking it we can use annotation in out pdfviewer.


To get a better understanding of your requirements, what version of the SDK are you using (ie. UWP, Windows, iOS, Android)? If you could provide us with additional details about your environment, that would be most helpful.

i am using Android Version 9.0.2 .

Hi @chiragthummar16 ,

Just to clarify, are you looking to select the text highlight annotation tool when your button is pressed? If so, you can do so by setting up ToolManager with PDFViewCtrl and calling the ToolManager.setTool API as follows:

ToolManager mToolManager = ...
// Set annotation tool to text highlight
mToolManager.setTool(mToolManager.createTool(ToolManager.ToolMode.TEXT_HIGHLIGHT, null))

You can learn more about setting up ToolManager with PDFViewCtrl here:

You can also check out our PDFViewCtrl sample to get started: pdftron-android-samples/PDFViewCtrlViewer at master · PDFTron/pdftron-android-samples · GitHub

Best Regards,

i have tried but after completing that annotation when i tap on it it does not come up with selection box.

Hi, selection box after tapping annotation is provided out of box in PDFTron and there is no work you need to do to achieve it.

I’m having a hard time understanding what you are trying to do, please provide a sample project, exact steps to reproduce, either in words or in the form of a video. Thanks.