Some test text!

keyboard_arrow_down

Get started

Download PDFTron SDK
play_arrow

Quick start - view a document

Integrate with NuGetIntegrate manuallyRun samplesAdd license keyUpdate to latest version
keyboard_arrow_down

Xamarin.Forms

keyboard_arrow_down

Fundamentals

Java binding (Android)Objective-C binding (iOS)Code sharingDocument lockingDocument saving
keyboard_arrow_down

FAQ

System requirementsPDFTron full vs. standardReduce size of APK
keyboard_arrow_down

Document Viewer

play_arrow

Xamarin.Android

OverviewShow a document in an ActivityShow a document in a FragmentViewer configurationToolManager configurationDay and Night themes
play_arrow

Xamarin.iOS

Show a document in a ViewControllerShow documents in a tabbed ViewControllerOpen from online URL
keyboard_arrow_down

Document Viewer components

Overview
play_arrow

PDFViewCtrl

Xamarin.AndroidXamarin.iOS
play_arrow

Reflow

Quick menuCustomize quick menu
play_arrow

Annotation toolbar

Xamarin.AndroidXamarin.iOS
play_arrow

Annotation style editor

play_arrow

Page slider

Xamarin.AndroidXamarin.iOS
play_arrow

List container

Xamarin.AndroidXamarin.iOS
play_arrow

Annotation list

play_arrow

Document outline

play_arrow

User bookmark list

play_arrow

Thumbnail browser

Add pages dialogCrop pages dialogRotate pages dialogView mode dialog
keyboard_arrow_down

Annotation and collaboration

OverviewToolManager setupRead only mode
play_arrow

Disable annotation creation and editing

Xamarin.AndroidXamarin.iOS
play_arrow

Default annotation properties

Xamarin.AndroidXamarin.iOS
play_arrow

Change tool mode

Xamarin.AndroidXamarin.iOS
play_arrow

Events

Xamarin.AndroidXamarin.iOS
play_arrow

Override annotation handling

Show and hide existing annotationsRealtime collaboration
keyboard_arrow_down

Advanced customization

play_arrow

Add a custom view to a page

Xamarin.AndroidXamarin.iOSCreate a custom toolPage coloring modePage fit modePage layout modeScrolling direction
keyboard_arrow_down

Conversion

keyboard_arrow_down

Parsing and extraction

keyboard_arrow_down

Digital signatures

Overview
keyboard_arrow_down

Search

keyboard_arrow_down

Advanced topics

PrintUnderstand coordinatesGenerate page thumbnails
keyboard_arrow_down

Troubleshooting

keyboard_arrow_down

Reference

keyboard_arrow_down

PDF Processing API

Default annotation properties

In this document
chevron_rightProgrammatically
chevron_rightXML attributes
chevron_rightSet a tool's default style
chevron_rightOverride an existing tool's default style
chevron_rightTool style attributes
This tutorial only applies to Xamarin.Android.

linkProgrammatically

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 properties are saved in the app's SharedPreferences.

These default properties can be changed programmatically and will take effect the next time when the annotation is created.

For example, to change style properties of a rectangle:

where toolManager is an instance of ToolManager.

A table for annotation type and tool mode mapping can be found here: annotation and its creation tool.

linkXML attributes

Each annotation has a default style that is defined by its creation tool. For example, when you create a Square annotation using the tool for the first time, the default behavior to draw a rectangle with a red border and a transparent fill color. These default colors can changed through XML attributes.

However the effect will only take place when the app is first loaded.

linkSet a tool's default style

  1. Add a style to your styles.xml file. For details on supported style attributes, see Tool Style Attributes.

    <style name="ShapeProperty">
        <!-- border color -->
        <item name="annot_color">@android:color/white</item>
        <!-- fill color -->
        <item name="annot_fill_color">@android:color/white</item>
        <!-- thickness -->
        <item name="annot_thickness">1.0</item>
        <!-- opacity -->
        <item name="annot_opacity">1.0</item>
    </style>
  2. Add the style resource to ToolStyleConfig by calling AddDefaultStyleMap(Int32, Int32).

    The first parameter of addDefaultStyleMap is an annotation type. You can determine the annotation type from the creator tool by referring to the Table of annotations and its creation tool.

linkTool style attributes

linkannot_color

Annotation color. For annotations that have an annot_fill_color, it represents stroke color.

format: color

linkannot_text_color

Annotation text color. Used for FreeText annotations.

format: color

linkannot_fill_color

Annotation fill color. Used for annotations that have fill colors, including Square, Circle, and FreeText.

format: color

linkannot_font_size

Annotation font size. Used for FreeText annotations.

format: float

linkannot_text_size_max

Represents a FreeText annotation's maximum font size.

format: float

linkannot_text_size_min

Represents a FreeText annotation's minimum font size.

format: float

linkannot_thickness

Annotation thickness for border style

format: float

linkannot_thickness_max

Annotation maximum thickness

format: float

linkannot_thickness_min

Annotation minimum thickness

format: float

linkannot_font

Annotation font. Used for FreeText annotations.

format: string

linkannot_opacity

Annotation opacity

format: float

linkannot_icon

Annotation icon. Used for Text annotations.

format: string