Some test text!

keyboard_arrow_down

Get started

Quick start - view a documentDownload PDFTron SDKIntegrate with GradleIntegrate manuallyRun samplesAdd license keyUpdate to latest versionTroubleshooting
keyboard_arrow_down

FAQ

System requirementsDocument lockingDocument savingRun project in Android StudioRun project with source codePDFTron full vs. standardReduce size of APK
keyboard_arrow_down

Document Viewer

OverviewShow a document in an ActivityShow a document in a FragmentViewer configurationToolManager configurationDay and Night themesOpen from online URL
keyboard_arrow_down

Document Viewer components

OverviewPDFViewCtrlReflowQuick menuCustomize quick menuAnnotation toolbarAnnotation style editorCustomize annotation style editorPage sliderList containerAnnotation listDocument outlineUser bookmark listThumbnail browserAdd pages dialogCrop pages dialogRotate pages dialogView mode dialog
keyboard_arrow_down

Annotation and collaboration

OverviewRead only modeDisable annotation creation and editingDefault annotation propertiesChange tool modeEventsOverride annotation handlingShow and hide existing annotationsUndo and redoRealtime collaboration
keyboard_arrow_down

Advanced customization

OverviewAdd a custom view to a pageCreate a custom toolPage coloring modePage fit modePage layout modeScrolling directionRight-to-left support
keyboard_arrow_down

Conversion

keyboard_arrow_down

Parsing and extraction

keyboard_arrow_down

Digital signatures

keyboard_arrow_down

Search

keyboard_arrow_down

Advanced topics

PrintUnderstand coordinatesGenerate page thumbnailsChange annotation propertiesDelete annotationsTool class hierarchy
keyboard_arrow_down

Other frameworks

keyboard_arrow_down

Troubleshooting

Multidex build errorReduce memory consumptionDetachCurrentThread warning
keyboard_arrow_down

Reference

ProGuardLocalizationIcon cheat sheet
keyboard_arrow_down

PDF Processing API

What is PDFNet?Opening a documentSerializing (saving) a documentWorking with pagesWorking with Page ContentWorking with BookmarksWorking with Interactive Forms (AcroForms)PDF SecurityLow-level PDF APIError handling
ToolManager configurationkeyboard_arrow_down

ToolManager configuration

In this document
chevron_rightBuild a default ToolManager
chevron_rightBuild a custom ToolManager
chevron_rightXML style attributes

You will need to use ToolManager for PDF interaction tools to work. You can build it easily using ToolManagerBuilder, a helper class for configuring and creating ToolManager. It also sets ToolManager to a specific PDFViewCtrl.

linkBuild a default ToolManager

To build a default ToolManager, use ToolManagerBuilder and pass in an instance of PDFViewCtrl:

linkBuild a custom ToolManager

You can also customize the ToolManager by defining an Android style resource and passing it to ToolManagerBuilder:

  1. Create a custom style in your res/values/styles.xml file:

    <style name="MyToolManager">
        <!-- allow editing ink annotations (only works if annotation toolbar is present) -->
        <item name="edit_ink_annots">true</item>
        <!-- disable image stamper tool -->
        <item name="add_image_stamper_tool">false</item>
        <!-- when ink selected in annotation toolbar, it should open its own ink toolbar -->
        <item name="open_toolbar_on_pan_ink_selected">true</item>
        <!-- hide the built-in page number indicator -->
        <item name="build_in_page_number_indicator">false</item>
        <!-- whether to copy marked-up text of TextMarkup annot to annotation's 'content' property upon TextMarkup annotation creation -->
        <item name="copy_annotated_text_to_note">true</item>
        <!-- remove some tools from AnnotationToolbar and QuickMenu -->
        <item name="disable_tool_modes">@array/disable_tool_modes</item>
    </style>

    For additional customization, a list of supported style attributes are defined in this table.

  2. In the previous step, @array/disable_tool_modes is a string array defining tool modes that should be disabled. You can define it in res/values/arrays.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string-array name="disable_tool_modes">
            <item>TEXT_ANNOT_CREATE</item>
            <item>TEXT_CREATE</item>
            <item>TEXT_SQUIGGLY</item>
            <item>INK_ERASER</item>
            <item>FORM_CHECKBOX_CREATE</item>
            <item>RECT_CREATE</item>
            <item>TEXT_LINK_CREATE</item>
        </string-array>
    </resources>

    Each <item> in the array needs to be a string matching one of the enum values from ToolManager.ToolMode.

    You can also set up ToolManagerBuilder programmatically. For a list of settings available, see the ToolManagerBuilder API.
  3. Lastly, build the ToolManager using ToolManagerBuilder and pass in your custom style and an instance of PDFViewCtrl:

    Alternatively, you can pass the ToolManager style resource directly to ViewerConfig.Builder. You can learn more about configuring ToolManager with ViewerConfig in the viewer configuration guides.

linkXML style attributes

AttributesDescriptionFormat
edit_ink_annotsControls whether editing ink annotations is allowed (only works if annotation toolbar is present)

Default value: false
Format: boolean
open_toolbar_on_pan_ink_selectedWhether annotation toolbar should open when Ink is selected from quick menu (only works if annotation toolbar is present)

Default value: false
Format: boolean
build_in_page_number_indicatorWhether to use/show the built-in page number indicator

Default value: true
Format: boolean
annot_permission_checkWhether to check annotation author's permission

Default value: false
Format: boolean
show_author_dialogWhether to show author dialog the first time the user annotates

Default value: false
Format: boolean
copy_annotated_text_to_noteWhether to copy marked-up text of TextMarkup annot to annotation's 'content' property upon TextMarkup annotation creation

Default value: false
Format: boolean
stylus_as_penWhether to enable using stylus to draw without having to enter ink tool

Default value: false
Format: boolean
ink_smoothing_enabledWhether to smooth ink annotations

Default value: true
Format: boolean
auto_select_annotationWhether to auto-select annotations after they are created

Default value: true
Format: boolean
quick_menu_disableWhether disable showing quick menu

Default value: false
Format: boolean
double_tap_to_zoomWhether double-tapping should zoom the viewer

Default value: true
Format: boolean
auto_resize_freetextWhether can auto resize free text bounding box when editing

Default value: false
Format: boolean
realtime_annot_editWhether annotation editing is real time

Default value: true
Format: boolean
edit_freetext_on_tapWhether can edit freetext on tap

Default value: false
Format: boolean
show_saved_signaturesWhether can show saved signatures in signature dialog

Default value: true
Format: boolean
show_annot_indicatorWhether can show indicator for annotations with comments

Default value: true
Format: boolean
disable_tool_modesArray of tools to disable

Default value: null
Format: reference
disable_annot_editing_by_typesArray of annotation types to disable editing

Default value: null
Format: reference