Home » Android » android – Highlight text on a PDF

android – Highlight text on a PDF

Posted by: admin May 14, 2020 Leave a comment


I have compiled MuPDF correctly and have been able to run the sample app without an issue, but:


I want to have a functionality like highlights,underlines, sticky notes, arrows, lines, ovals, rectangles, freehand drawings and text boxes on which user long pressed by his finger, as in RepliGo PDF Reader pdf reader and others.

I searched a lot, but didn’t find any relevant way, link or hint to achieve the desired feature.

Can someone share any idea on how to achieve the aforementioned functionality?
It would be even more helpful if someone can explain it by sharing some code or example.

How to&Answers:

As MuPdf doesn’t expose apis for the features you require, I suggest using the PDFTron sdk library for android.

As you can see on their docs page, it supports lot of annotation related pdf features:

Ready-to-Use Tools for Rapid Development – including support for
advanced features such as text selection, full text search; links;
bookmark navigation and manipulation; interactive forms; various
annotation capabilities to enable PDF markup (text highlight,
underline, strikeout, squiggly, line, rectangle, ellipse, arrow,
sticky note, and free-hand tool mode, etc.).