We are pleased to introduce version 6.8.7 of PDFTron for iOS. This release adds new configuration APIs to disable annotation tools and other functionality, iOS 12 support, and more.

linkDisabling annotation tools and other functionality

With this release, it is now possible to control whether certain annotation can be created or edited without editing the open source Tools code.

For example, to disable creation and editing of text highlight annotations, simply call one of the new ToolManager methods:

// Disable text highlight annotation creation and editing.
self.toolManager.setPermissionsFor(.highlight, canCreate: false, canEdit: false)

Other functionality provided by the Tools project, like text selection and form filling, can now also be controlled.

To disable all text selection, the ToolManager's new flexible "interaction tool" API or convenience properties can be used:

// Disable text selection.
self.toolManager.setPermissionFor(.textSelection, enabled: false)

// OR
self.toolManager.isTextSelectionEnabled = false

For more information on the new ToolManager APIs for disabling tools, please see our guide.

linkConfiguration APIs

In addition to the new APIs described above, it is also possible to configure the ToolManager used by our drop-in document viewer and tabbed viewer components.

To configure a PTDocumentViewController's tool manager, a powerful builder API can be used to disable annotation tools and other functionality:

documentViewer.toolManager.configure(with: ToolManagerConfiguration { builder in
    // Disable editing of ink annotations.
    builder.annotPermissions = [
        .ink : [
            .canCreate : true,
            .canEdit : false,
        ],
    ]
    
    // Disable text selection.
    builder.interactionToolPermissions = [
        .textSelection : [
            .enabled : false,
        ],
    ]
})

This builder API can also be used to configure all the tabs of a PTTabbedDocumentViewController instance with the new configureWithToolManagerConfiguration: method.

linkAnd more...

For a full list of changes, please see the changelog for PDFTron 6.8.7 for iOS.

We hope you like these changes and any feedback is greatly appreciated. Please don't hesitate to contact us if you have any questions or suggestions. We also have many exciting new features planned for the coming weeks and months, so stay tuned.