Quick Menu

You can use a quick menu in the document viewer.

Annotation popup menu with long-press in Xamarin.Android

This tutorial only applies to Xamarin.Android.

QuickMenu is a convenient annotation popup menu that appears when a user long-presses on a blank space or on text contained in a PDFViewCtrl. It extends RelativeLayout and is a child view of PDFViewCtrl.

Action

Menu

Long-press on blank space

Apryse Docs Image

Long-press on text

Apryse Docs Image

To learn more about each icon, see the icon cheat sheet .

To learn how to customize the quick menu, see the customize quick menu guide .

Quick menu events

A number of events may be raised when a user interacts with the quick menu. For example, events will be raised when the quick menu is shown, dismissed, or when a quick menu item is clicked. .

If your activity is using PdfViewCtrlTabHostFragment2 for viewing PDF files, you can set your listener by calling:

C#

1mPdfViewCtrlTabHostFragment.CurrentPdfViewCtrlFragment.QuickMenuClicked += (sender, e) =>
2{
3 // Handle click event...
4}
5
6mPdfViewCtrlTabHostFragment.CurrentPdfViewCtrlFragment.QuickMenuShown += (sender, e) =>
7{
8 // Called when the quick menu is shown
9}
10
11mPdfViewCtrlTabHostFragment.CurrentPdfViewCtrlFragment.QuickMenuDismissed += (sender, e) =>
12{
13 // Called when the quick menu is dismissed
14}

Or you can register the listener using the ToolManager:

C#

1mToolManager.QuickMenuClicked += (sender, e) =>
2{
3 // Handle click event...
4}
5
6mToolManager.QuickMenuShown += (sender, e) =>
7{
8 // Called when the quick menu is shown
9}
10
11mToolManager.QuickMenuDismissed += (sender, e) =>
12{
13 // Called when the quick menu is dismissed
14}

Hide quick menu items

If there are tools that you would like to remove from the quick menu, you can hide them by calling ToolManager.DisableToolMode:

C#

1mToolManager.DisableToolMode(new ToolManager.ToolMode[] {
2 ToolManager.ToolMode.TextSquiggly,
3 ToolManager.ToolMode.TextStrikeout
4});

Then, when you long-press on text you will see:

Apryse Docs Image

ToolMode icon mapping table

Icon

ToolMode

Apryse Docs Image

RECT_CREATE

Apryse Docs Image

OVAL_CREATE

Apryse Docs Image

POLYLINE_CREATE

Apryse Docs Image

POLYGON_CREATE

Apryse Docs Image

CLOUD_CREATE

Apryse Docs Image

LINE_CREATE

Apryse Docs Image

ARROW_CREATE

Apryse Docs Image

RULER_CREATE

Apryse Docs Image

TEXT_CREATE

Apryse Docs Image

CALLOUT_CREATE

Apryse Docs Image

TEXT_ANNOT_CREATE

Apryse Docs Image

INK_CREATE

Apryse Docs Image

INK_ERASER

Apryse Docs Image

SIGNATURE

Apryse Docs Image

STAMPER

Apryse Docs Image

RUBBER_STAMPER

Apryse Docs Image

FREE_HIGHLIGHTER

Apryse Docs Image

TEXT_HIGHLIGHT

Apryse Docs Image

TEXT_UNDERLINE

Apryse Docs Image

TEXT_SQUIGGLY

Apryse Docs Image

TEXT_STRIKEOUT

Apryse Docs Image

ANNOT_EDIT_RECT_GROUP

Disable quick menu

If you would like to hide the long press quick menu entirely, you can do so by calling ToolManager.SetDisableQuickMenu. For example:

C#

1mToolManager.SetDisableQuickMenu(true);

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales