Some test text!

menu

Default annotation properties

Annotation properties have default settings and can be changed programmatically.

Default annotation properties

This tutorial only applies to Xamarin.iOS. See Xamarin.Android equivalent here.
When creating a new annotation, the initial properties (such as line thickness, fill colour, opacity, etc.) are set to the last value that the user selected for an annotation of that type. For example, if the user changes an ellipse annotation's stroke color from green to red, the next ellipse annotation that the user creates would have a stroke color of red. These default colors are saved in the app's user default dictionary.

The tools read and write values via the Tools packagePTColorDefaults type (class) interface.

linkExamples

Sets the default stroke color for rectangle annotations.

ColorDefaults.SetDefaultColor(UIColor.Green, PTAnnotType.e_ptSquare, "Color", ColorPostProcessMode.e_postprocess_none);

Available properties:

Property nameKey
Stroke color"Color"
Fill color"FillColor"
Opacity"Opacity"
Border thickness"BorderThickness"
Free text size"FreeTextSize"

Reads the default fill color for ellipse annotations.

var fillColor = PTColorDefaults.GetDefaultColorForAnnotType(PTAnnotType.e_ptCircle, "FillColor", ColorPostProcessMode.e_postprocess_none);

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.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more
close