Some test text!

menu
search

Disable annotation creation and editing

This tutorial only applies to Xamarin.iOS. See Xamarin.Android equivalent here.

The long-press popup menu and AnnotationToolbar show a default set of annotation creation tools. Editing of existing annotations is enabled for all annotation types by default. Other actions that are not tied to annotation creation, like text selection, form filling, and link following, are enabled by default.

linkDisable annotation tools

Annotation creation and editing can be disabled on the PTToolManager using the PTAnnotationOptions property for a particular annotation type, such as textAnnotationPermission

// Disable text highlight annotation creation and editing.
mToolManager.HighlightAnnotationPermission.CanCreate = false;
mToolManager.HighlightAnnotationPermission.CanEdit = false;

It is also possible to disable annotation creation and editing based on the PTExtendedAnnotType enum by accessing the PTAnnotationOptions for that type using the AnnotationPermissionForAnnotType method.

// Disable text highlight annotation creation and editing.
mToolManager.AnnotationPermissionForAnnotType(pdftron.PDF.PTExtendedAnnotType.Highlight).CanCreate = false;
mToolManager.AnnotationPermissionForAnnotType(pdftron.PDF.PTExtendedAnnotType.Highlight).CanEdit = false;

The PTExtendedAnnotType enum extends the basic PTAnnotType to further distinguish annotations based on their properties (line and arrow, polygon and cloudy, etc.). The extendedAnnotType property can be used to get the type of a Annot.

linkDisable functionality

Functionality that is not directly tied to annotations,like text selection, form filling, link following, and ink erasing, can be disabled on the PTToolManager via convenience properties, for example LinkFollowingEnabled:

// Disable link following.
mToolManager.LinkFollowingEnabled = false;

The code above disables link following for link annotations and text links detected by the PDFViewCtrl (the SetUrlExtraction method must be called on the PDFViewCtrl to enable text link detection).

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close