Apryse SDK provides various UI components to make a large degree of customization available to the user.
The highly configurable all-in-one document reader and PDF editor that comes with the Apryse Android SDK is composed of Material Design UI components that are available in the tools package. These components can be used as part of your application to create customizable UI that interact with the document viewer. A visual reference for these components is shown below:
Key | UI Component | Description |
---|---|---|
1 | PDFViewCtrl is a ViewGroup that can be embedded in any layout. It encapsulates a rich set of functionalities for interactive viewing of documents | |
2 | Toolbar Switcher | Allows users to switch between annotation toolbars and access different tools |
3 | Tab Switcher | View the previews of multiple documents as tabs |
4 | Allows users to: pick page presentation mode, select page color mode, rotate pages, and crop pages | |
Manually or automatically crop pages in a document | ||
Extract the reflowable layout of each page in a document to an HTML file | ||
Add new pages to an existing document or create a new document with new pages | ||
Rotate pages of the opened document by 90, 180 and 270 degrees | ||
Share document | Share a document from your app | |
5 | Edit pages of a document including add, remove, re-arrange, rotate and duplicate pages | |
6 | Search text in a document | |
7 | Strips down the UI so that users can focus on reading a document's content | |
8 | List container | A horizontal layout to display the Annotation list, Document outline, and User-defined bookmark list in separate tabs |
Shows a list of all annotations in a document | ||
Shows a document outline (PDF Bookmark) that can be used to navigate the document | ||
Shows a list of user-defined bookmarks that can be used to navigate the document | ||
9 | A toolbar consisting of various annotation creation tools | |
10 | A convenient annotation popup menu that appears when a user long-presses on a blank space or on text, or presses an annotation | |
11 | Displays annotation style properties in a bottom sheet for the user to edit |
For the legacy PTDocumentViewController
class, please see this guide .
This article explains how to customize the document viewer classes PTDocumentController
and PTTabbedDocumentViewController
.
Because the document viewer classes are part of the open source Tools UI framework, it is possible to achieve virtually any required modification. That said, it is usually faster and more convenient to configure the viewers via APIs, which this guide describes.
The above image (items 1–5) indicates areas that are controllable via the PTDocumentController
's API. Information on customizing these is available directly below.
The above image (items 7–12) indicates a number of default buttons that create and present new controls. Information on where to look to customize these presented controls can be found in the component controls table.
The image on the left (items 1–6) indicates areas that are controllable via the PTDocumentController
's API. Information on customizing these is available directly below.
The image on the right (items 7–12) indicates a number of default buttons that create and present new controls. Information on where to look to customize these presented controls can be found in the component controls table.
On iPad and other regular horizontal size class devices, a number of default UI controls are accessible from the navigation bar, whereas on iPhones and compact size classes some of those controls appear in the toolbar at the bottom of the view.
Image Number | Button | Functionality | Location on iPad | Location on iPhone |
---|---|---|---|---|
7 | searchButtonItem | navigationItem.rightBarButtonItems | navigationItem.rightBarButtonItems | |
8 | moreItemsButtonItem | navigationItem.rightBarButtonItems | navigationItem.rightBarButtonItems | |
10 | navigationListsButtonItem | navigationItem.leftBarButtonItems | toolbar | |
11 | thumbnailsButtonItem | navigationItem.leftBarButtonItems | toolbar | |
12 | readerModeButtonItem | navigationItem.rightBarButtonItems | toolbar |
The toolbar switcher can be hidden:
Toolbars can be removed by removing them from the toolGroupManager's groups array. The following code removes the "Draw" and "Pens" toolbars:
The buttons which are contained in the leftBarButtonItems
and rightBarButtonItems
arrays, are completely customizable. It is possible to
You can modify the navigation bar items. Here is an example of adding a new button (for the current size class):
Tools can also be added:
Note that in the example above, de-selecting the tool button item needs to be implemented by the app, by listening to the Tool Did Change notification.
To remove any of the default buttons see the instructions here: Hide default buttons
The default buttons are all accessible via properties, making it easy to rearrange or move them. The following code swaps the position of the search button and navigation lists button:
The icons of existing buttons may be changed by creating new UIBarButtonItems
that have the same target and action as an existing item, and replacing the existing item with the new item:
The currently-visible annotation toolbar is selected with the toolbar switcher.
The toolbar can be programmatically hidden by setting the mode to view group, which is a special group and the only group where the toolbar is hidden:
The toolbar can be shown again by changing the group to any group other than view:
The example below shows how to remove the text highlight and text underline button from a toolbar.
Disabling a tool type entirely
If you want to disable a tool entirely, from all toolbars and the long press menu, please use the annotations permissions system.
The page indicator can be enabled/disabled via the pageIndicatorEnabled
property.
The PTPDFViewCtrl
is a UIView
that displays the PDF. It is customizable via is properties/methods and delegate methods.
For an overview see the PTPDFViewCtrl Guide , or the detailed API documentation.
Note that all PDF "interaction" (annotations, form filling, text selection, link following, etc.) is supplementary to the PDFViewCtrl, and is implemented in the open source tools.framework
.
These are the buttons that appear at the bottom of the screen on iPhones and in Compact horizontal size classes. Buttons can be added, removed, or rearranged with convenient APIs.
To remove any of the default buttons see the instructions here: Hide default buttons
To customize the controls that are presented by the PTDocumentController
's default buttons, please see the corresponding guide or API:
Image number | Control |
---|---|
7 | |
8 | |
9 | |
10 | |
11 | |
12 |
Default buttons can be removed ("hidden") using built-in properties.
searchButtonHidden
moreItemsButtonHidden
navigationListsButtonHidden
thumbnailBrowserButtonHidden
readerModeButtonHidden
For example to hide the search and more items buttons:
The tabbed document view controller displays a collection of document controllers in tabs.
Tabs can be disabled using the TabsEnabled
property, and the maximum number of allowed tabs can be set using MaximumTabCount
.
The current document controller can be accessed via SelectedViewController
, and others via documentViewControllerAtIndex
To configure a document controller before it is displayed, conform to and implement the PTTabbedDocumentViewControllerDelegate
method willAddDocumentViewController
. Note that it is permissible to assign the internal PTDocumentViewController
's delegate to an external object.
API | Functionality |
---|---|
Enables/disables tabs. | |
Controls the maximum number of concurrent tabs. | |
The current | |
The | |
Access to a |
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales