Some test text!

menu
Default style propertieskeyboard_arrow_down

Setting default annotation properties in iOS viewer

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.frameworkPTColorDefaults type (class) interface.

It is possible to use this interface from outside of the tools framework itself, and you could do so based on events within your app or when notified of certain events by the PTToolManager.

linkExamples

Sets the default stroke color for rectangle annotations.

PTColorDefaults.setDefaultColor(UIColor.green, forAnnotType: e_ptSquare, attribute: ATTRIBUTE_STROKE_COLOR, colorPostProcessMode: e_ptpostprocess_none)

Reads the default fill color for ellipse annotations.

let fillColor = PTColorDefaults.defaultColor(forAnnotType: e_ptCircle, attribute: ATTRIBUTE_FILL_COLOR, colorPostProcessMode: pdfViewCtrl.getColorPostProcessMode())

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.