public static class

PdfActivityConfiguration.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.configuration.activity.PdfActivityConfiguration.Builder

Class Overview

Builder used to construct a PdfActivityConfiguration instance.

Summary

Public Constructors
Builder(Context context)
Creates a new PdfActivity configuration builder.
Builder(PdfActivityConfiguration configuration)
Create a new builder from existing configuration.
Builder(PdfActivityConfiguration configuration, int themeRes)
Create a new builder from existing configuration.
Builder(PdfActivityConfiguration configuration, int themeRes, int themeDarkRes)
Create a new builder from existing configuration.
Public Methods
PdfActivityConfiguration.Builder allowMultipleBookmarksPerPage(boolean allowed)
Sets whether multiple bookmarks per page can be added or not.
PdfActivityConfiguration.Builder animateScrollOnEdgeTaps(boolean enabled)
Sets whether page changes triggered by tapping the page edge cause an animation.
PdfActivityConfiguration.Builder annotationReplyFeatures(AnnotationReplyFeatures annotationReplyFeatures)
Configures which part of the annotation replies UI is enabled.
PdfActivityConfiguration.Builder automaticallyGenerateLinks(boolean automaticallyGenerateLinks)
Enables or disables automatic link generation.
PdfActivityConfiguration.Builder autosaveEnabled(boolean isAutosaveEnabled)
Enables or disables autosaving of modified PDF documents.
PdfActivityConfiguration.Builder backgroundColor(int backgroundColor)
Sets color of PDF background.
PdfActivityConfiguration build()
Generates the PdfActivityConfiguration instance.
PdfActivityConfiguration.Builder configuration(PdfConfiguration configuration)
Replaces all properties from the PdfConfiguration
PdfActivityConfiguration.Builder defaultSigner(String signerIdentifier)
Defines the default signer to be selected when signing a document.
PdfActivityConfiguration.Builder disableAnnotationEditing()
Disables annotation editing functionality.
PdfActivityConfiguration.Builder disableAnnotationLimitedToPageBounds()
Disables the page bounds limit imposed when dragging annotations.
PdfActivityConfiguration.Builder disableAnnotationList()
Disables the list of annotations.
PdfActivityConfiguration.Builder disableAnnotationRotation()
Disables annotation rotation functionality.
PdfActivityConfiguration.Builder disableBookmarkEditing()
Disabled editing controls on the bookmarks list.
PdfActivityConfiguration.Builder disableBookmarkList()
Disables the display of bookmarks.
PdfActivityConfiguration.Builder disableContentEditing()
Disables content editing functionality.
PdfActivityConfiguration.Builder disableCopyPaste()
Disables copy and paste of annotations.
PdfActivityConfiguration.Builder disableDocumentEditor()
Disables document editing functionality in the page grid.
PdfActivityConfiguration.Builder disableDocumentInfoView()
Disables the document info view.
PdfActivityConfiguration.Builder disableFormEditing()
Disables form editing functionality.
PdfActivityConfiguration.Builder disableOutline()
Disables outline menu in the activity.
PdfActivityConfiguration.Builder disablePrinting()
Hides printing option in the sharing menu even if printing can be done on the device.
PdfActivityConfiguration.Builder disableSearch()
Disables document search functionality.
PdfActivityConfiguration.Builder editableAnnotationTypes(List<AnnotationType> editableAnnotationTypes)
Sets a list of annotation types that can be selected on page and edited.
PdfActivityConfiguration.Builder enableAnnotationEditing()
Enables annotation editing functionality.
PdfActivityConfiguration.Builder enableAnnotationList()
Enables the list of annotations.
PdfActivityConfiguration.Builder enableAnnotationRotation()
Enables annotation rotation functionality.
PdfActivityConfiguration.Builder enableBookmarkEditing()
Enables editing controls on the bookmarks list.
PdfActivityConfiguration.Builder enableBookmarkList()
Enables the display of bookmarks.
PdfActivityConfiguration.Builder enableContentEditing()
Enables content editing functionality.
PdfActivityConfiguration.Builder enableCopyPaste()
Enables copy and paste of annotations.
PdfActivityConfiguration.Builder enableDocumentEditor()
Enables document editing functionality in the page grid.
PdfActivityConfiguration.Builder enableDocumentInfoView()
Enables the document info view.
PdfActivityConfiguration.Builder enableFormEditing()
Enables form editing functionality.
PdfActivityConfiguration.Builder enableMagnifier(boolean enabled)
Sets whether the magnifier is shown when text selection handles are touched.
PdfActivityConfiguration.Builder enableOutline()
Enables outline menu in the activity.
PdfActivityConfiguration.Builder enablePrinting()
Enables printing option in the menu if applicable for the document and the device.
PdfActivityConfiguration.Builder enableReaderView(boolean readerViewEnabled)
Sets whether we enable the reader view in the activity or not.
PdfActivityConfiguration.Builder enableSearch()
Enables document search functionality.
PdfActivityConfiguration.Builder enabledAnnotationTools(List<AnnotationTool> enabledAnnotationTools)
Sets a list of annotation tools that are enabled.
PdfActivityConfiguration.Builder excludedAnnotationTypes(List<AnnotationType> excludedAnnotationTypes)
Sets a list of annotation types that will be excluded from rendering.
PdfActivityConfiguration.Builder firstPageAlwaysSingle(boolean firstPageAlwaysSingle)
Sets whether the first page should always be displayed as a single or not.
PdfActivityConfiguration.Builder fitMode(PageFitMode mode)
Sets the page fit mode.
PdfActivityConfiguration.Builder forceSignatureButtonPositionInMainToolbar(boolean forceSignatureButtonPositionInMainToolbar)
Forces the signature button to show up in the main toolbar.
PdfActivityConfiguration.Builder hideDocumentTitleOverlay()
Hides the overlay displaying the document title.
PdfActivityConfiguration.Builder hideNavigationButtons()
Hides the navigation buttons.
PdfActivityConfiguration.Builder hidePageLabels()
Hides page labels (if any).
PdfActivityConfiguration.Builder hidePageNumberOverlay()
Hides the overlay displaying currently selected page.
PdfActivityConfiguration.Builder hideSettingsMenu()
Hides the settings menu icon.
PdfActivityConfiguration.Builder hideThumbnailGrid()
Hides the actionbar icon to show grid of thumbnail pages.
PdfActivityConfiguration.Builder hideUserInterfaceWhenCreatingAnnotations(boolean hideUserInterfaceWhenCreatingAnnotations)
Sets to automatically hide user interface controls when annotation creation toolbar position is in vertical position (left/right).
PdfActivityConfiguration.Builder invertColors(boolean invertColors)
Sets if the colors will be inverted in the document.
PdfActivityConfiguration.Builder layout(int layoutRes)
Sets a layoutRes used by the launched activity.
PdfActivityConfiguration.Builder layoutMode(PageLayoutMode mode)
Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically).
PdfActivityConfiguration.Builder listedAnnotationTypes(EnumSet<AnnotationType> listedAnnotationTypes)
Sets the annotation types that should be displayed in the annotation list.
PdfActivityConfiguration.Builder loadingProgressDrawable(Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded.
PdfActivityConfiguration.Builder maxZoomScale(float scale)
Sets the maximum zoom scale at which the document should be displayed.
PdfActivityConfiguration.Builder memoryCacheSize(int memoryCacheSize)
Sets size of memory cache for rendered pages and bitmaps.
PdfActivityConfiguration.Builder page(int pageIndex)
Sets the page to start the document at.
PdfActivityConfiguration.Builder pagePadding(int pagePaddingDp)
Sets the padding between pages.
PdfActivityConfiguration.Builder redoEnabled(boolean redoEnabled)
Enables or disables redo support.
PdfActivityConfiguration.Builder restoreLastViewedPage(boolean restoreLastViewedPage)
Enables or disables restoration of the last viewed page when reopening a document.
PdfActivityConfiguration.Builder scrollDirection(PageScrollDirection orientation)
Sets the scrolling direction (i.e.
PdfActivityConfiguration.Builder scrollMode(PageScrollMode mode)
Sets the scrolling mode.
PdfActivityConfiguration.Builder scrollOnEdgeTapEnabled(boolean enabled)
Sets whether taps on the edge of a page scroll to the next / previous page.
PdfActivityConfiguration.Builder scrollOnEdgeTapMargin(int marginDp)
Margin in dp in which taps on the edge of the page will trigger the page navigation.
PdfActivityConfiguration.Builder scrollbarsEnabled(boolean scrollbarsEnabled)
Sets the document scrollbars to be enabled or disabled.
PdfActivityConfiguration.Builder searchConfiguration(SearchConfiguration searchConfiguration)
Sets configuration used for searching, applied to search views.
PdfActivityConfiguration.Builder setAnnotationInspectorEnabled(boolean isEnabled)
Sets whether the annotation inspector is enabled.
PdfActivityConfiguration.Builder setAnnotationListReorderingEnabled(boolean enable)
Sets whether reordering annotations in the annotation list is enabled.
PdfActivityConfiguration.Builder setAnnotationNoteHintingEnabled(boolean isEnabled)
Enables or disables visual indicator shown for annotations that have annotation notes.
PdfActivityConfiguration.Builder setDocumentInfoViewSeparated(boolean separated)
The documeninfo view is now by default in a separate window and no longer in the outlineview.
PdfActivityConfiguration.Builder setEnableNoteAnnotationNoZoomHandling(boolean noZoomHandlingEnabled)
Enables or disables handling for NOZOOM flag for note annotations.
PdfActivityConfiguration.Builder setEnabledCopyPasteFeatures(EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the CopyPasteFeatures that are enabled.
PdfActivityConfiguration.Builder setEnabledShareFeatures(EnumSet<ShareFeatures> enabledShareFeatures)
Configures which share features are enabled in the UI.
PdfActivityConfiguration.Builder setJavaScriptEnabled(boolean isEnabled)
Enables or disables JavaScript processing.
PdfActivityConfiguration.Builder setMeasurementToolsEnabled(boolean measurementToolsEnabled)
Enables or disables measurement tools functionality.
PdfActivityConfiguration.Builder setMultithreadedRenderingEnabled(boolean isMultithreadedRenderingEnabled)
Sets whether the multithreaded rendering should be enabled.
PdfActivityConfiguration.Builder setRedactionUiEnabled(boolean redactionUiEnabled)
Sets whether we show the UI to apply redactions when there are RedactionAnnotation in the document or not.
PdfActivityConfiguration.Builder setResizeGuideLineIntervals(List<Float> intervals)
Sets guide line on/off intervals sizes.
PdfActivityConfiguration.Builder setResizeGuideSnapAllowance(float snapAllowance)
Sets how aggressively the resize guides works.
PdfActivityConfiguration.Builder setSearchType(int searchType)
Sets the search type (if search is enabled).
PdfActivityConfiguration.Builder setSelectedAnnotationResizeEnabled(boolean enabled)
Enable or disable resizing of selected annotations.
PdfActivityConfiguration.Builder setSelectedAnnotationResizeGuidesEnabled(boolean enabled)
Enables or disables resize guides.
PdfActivityConfiguration.Builder setSelectedFreetextAnnotationFontScalingOnResizeEnabled(boolean enabled)
Enables or disables resize guides.
PdfActivityConfiguration.Builder setSettingsMenuItems(EnumSet<SettingsMenuItemType> settingsMenuItemShown)
Sets the items to show in the settings menu.
PdfActivityConfiguration.Builder setSignaturePickerOrientation(SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker.
PdfActivityConfiguration.Builder setTabBarHidingMode(TabBarHidingMode tabBarHidingMode)
Configures the tab bar hiding mode.
PdfActivityConfiguration.Builder setThumbnailBarMode(ThumbnailBarMode thumbnailBarMode)
Sets the thumbnail bar mode.
PdfActivityConfiguration.Builder setUserInterfaceViewMode(UserInterfaceViewMode userInterfaceViewMode)
Sets the user interface view mode.
PdfActivityConfiguration.Builder setVolumeButtonsNavigationEnabled(boolean isVolumeButtonsNavigationEnabled)
Enables or disables volume buttons navigation.
PdfActivityConfiguration.Builder showDocumentTitleOverlay()
Shows overlay displaying the document title.
PdfActivityConfiguration.Builder showGapBetweenPages(boolean showGapBetweenPages)
Sets whether to show gao between pages in double page mode or not.
PdfActivityConfiguration.Builder showNavigationButtons()
Shows the navigation buttons.
PdfActivityConfiguration.Builder showPageLabels()
Enables display of the page labels (if any).
PdfActivityConfiguration.Builder showPageNumberOverlay()
Shows overlay displaying current page number over document.
PdfActivityConfiguration.Builder showSettingsMenu()
Shows the settings menu icon.
PdfActivityConfiguration.Builder showSignHereOverlay(boolean showOverlay)
Sets whether the sign here overlay is shown inside of signature form fields.
PdfActivityConfiguration.Builder showThumbnailGrid()
Displays an actionbar icon to show grid of thumbnail pages.
PdfActivityConfiguration.Builder signatureAppearance(SignatureAppearance signatureAppearance)
Defines the appearance of the digital signature that is added after digitally signing a document.
PdfActivityConfiguration.Builder signatureCertificateSelectionMode(SignatureCertificateSelectionMode signatureCertificateSelectionMode)
Defines if the user should be able to select certificates for digitally signing a document, when creating a new signature.
PdfActivityConfiguration.Builder signatureColorOptions(SignatureColorOptions signatureColorOptions)
Defines the 3 signature color options available when using the Electronic Signatures "Draw" or "Type" signing UI.
PdfActivityConfiguration.Builder signatureCreationModes(List<SignatureCreationMode> signatureCreationModes)
The ways in which the user can choose to add their signature.
PdfActivityConfiguration.Builder signatureSavingStrategy(SignatureSavingStrategy signatureSavingStrategy)
Signature saving strategy used within the dialog when adding signatures.
PdfActivityConfiguration.Builder startZoomScale(float startZoomScale)
Sets the start scale at which the document will be displayed.
PdfActivityConfiguration.Builder textSelectionEnabled(boolean isTextSelectionEnabled)
Enables or disables text selection (both programmatically and via long-press gesture).
PdfActivityConfiguration.Builder textSelectionPopupToolbarEnabled(boolean enabled)
Sets whether the text selection popup toolbar is enabled or not.
PdfActivityConfiguration.Builder theme(int themeRes)
Sets a themeRes used to override default activity theme.
PdfActivityConfiguration.Builder themeDark(int themeDarkRes)
Sets a themeDarkRes used to override dark activity theme.
PdfActivityConfiguration.Builder themeMode(ThemeMode mode)
Sets the app theme mode.
PdfActivityConfiguration.Builder title(String title)
Sets the actionbar activity title.
PdfActivityConfiguration.Builder toGrayscale(boolean toGrayscale)
Sets if the colors will be converted to grayscale.
PdfActivityConfiguration.Builder undoEnabled(boolean undoEnabled)
Enables or disables undo support.
PdfActivityConfiguration.Builder useImmersiveMode(boolean useImmersiveMode)
Enabled immersive fullscreen mode in the activity.
PdfActivityConfiguration.Builder videoPlaybackEnabled(boolean videoPlaybackEnabled)
Enables or disables video playback.
PdfActivityConfiguration.Builder zoomOutBounce(boolean zoomOutBounce)
Should the zoom out below the minimum zoom have a bounce-back effect on a page.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder (Context context)

Creates a new PdfActivity configuration builder.

Parameters
context Context object needed for initialization.

public Builder (PdfActivityConfiguration configuration)

Create a new builder from existing configuration.

Parameters
configuration PdfConfiguration used to initialized builder.

public Builder (PdfActivityConfiguration configuration, int themeRes)

Create a new builder from existing configuration.

Parameters
configuration PdfConfiguration used to initialized builder.
themeRes Theme used in the new configuration.

public Builder (PdfActivityConfiguration configuration, int themeRes, int themeDarkRes)

Create a new builder from existing configuration.

Parameters
configuration PdfConfiguration used to initialized builder.
themeRes Theme used in the new configuration.
themeDarkRes Theme used in dark mode in the new configuration.

Public Methods

public PdfActivityConfiguration.Builder allowMultipleBookmarksPerPage (boolean allowed)

Sets whether multiple bookmarks per page can be added or not. If disabled only one bookmark will be allowed per page. Defaults to false allowing only one bookmark per page.

Parameters
allowed true to allow adding multiple bookmarks to a page, or false so that only one bookmark can be added per page.

public PdfActivityConfiguration.Builder animateScrollOnEdgeTaps (boolean enabled)

Sets whether page changes triggered by tapping the page edge cause an animation. Defaults to false making the transition instant.

Parameters
enabled true to enable page change animation, false to disable page change animation when tapping the page edge.

public PdfActivityConfiguration.Builder annotationReplyFeatures (AnnotationReplyFeatures annotationReplyFeatures)

Configures which part of the annotation replies UI is enabled. If ENABLED, the replies can be added to note annotations and annotation notes. If READ_ONLY, the replies can be looked at but none can be added or modified. If DISABLED, the reply UI is disabled entirely. This feature is only UI specific, defining the replies availability in the PdfFragment's UI. The API for retrieving and adding replies still works even if this property is DISABLED.

Parameters
annotationReplyFeatures Which features of annotation reply UI to enable.

public PdfActivityConfiguration.Builder automaticallyGenerateLinks (boolean automaticallyGenerateLinks)

Enables or disables automatic link generation. If true we will automatically parse the text and generate clickable links for all URLs and eMail addresses in the document text.

Parameters
automaticallyGenerateLinks true to enable automatic link generation, or false to disable it.

public PdfActivityConfiguration.Builder autosaveEnabled (boolean isAutosaveEnabled)

Enables or disables autosaving of modified PDF documents. This is enabled by default.

Parameters
isAutosaveEnabled true to enable autosave in onStop().

public PdfActivityConfiguration.Builder backgroundColor (int backgroundColor)

Sets color of PDF background. Color#WHITE by default.

Parameters
backgroundColor PDF paper color in integer ARGB format.

public PdfActivityConfiguration build ()

Generates the PdfActivityConfiguration instance.

Returns
  • Configured activity configuration instance.

public PdfActivityConfiguration.Builder configuration (PdfConfiguration configuration)

Replaces all properties from the PdfConfiguration

Parameters
configuration Configuration which properties will be copied to this builder.

public PdfActivityConfiguration.Builder defaultSigner (String signerIdentifier)

Defines the default signer to be selected when signing a document.

Parameters
signerIdentifier Identifier string with which the signer was registered in SignatureManager, or null to have no default signer.

public PdfActivityConfiguration.Builder disableAnnotationEditing ()

Disables annotation editing functionality.

public PdfActivityConfiguration.Builder disableAnnotationLimitedToPageBounds ()

Disables the page bounds limit imposed when dragging annotations. By default this is enabled. Note: this is an experimental feature - we cannot guarantee flawless behaviour or that it won't change in future.

public PdfActivityConfiguration.Builder disableAnnotationList ()

Disables the list of annotations.

public PdfActivityConfiguration.Builder disableAnnotationRotation ()

Disables annotation rotation functionality.

public PdfActivityConfiguration.Builder disableBookmarkEditing ()

Disabled editing controls on the bookmarks list.

public PdfActivityConfiguration.Builder disableBookmarkList ()

Disables the display of bookmarks.

public PdfActivityConfiguration.Builder disableContentEditing ()

Disables content editing functionality.

public PdfActivityConfiguration.Builder disableCopyPaste ()

Disables copy and paste of annotations.

public PdfActivityConfiguration.Builder disableDocumentEditor ()

Disables document editing functionality in the page grid.

public PdfActivityConfiguration.Builder disableDocumentInfoView ()

Disables the document info view.

public PdfActivityConfiguration.Builder disableFormEditing ()

Disables form editing functionality.

public PdfActivityConfiguration.Builder disableOutline ()

Disables outline menu in the activity.

public PdfActivityConfiguration.Builder disablePrinting ()

Hides printing option in the sharing menu even if printing can be done on the device.

public PdfActivityConfiguration.Builder disableSearch ()

Disables document search functionality.

public PdfActivityConfiguration.Builder editableAnnotationTypes (List<AnnotationType> editableAnnotationTypes)

Sets a list of annotation types that can be selected on page and edited.

Parameters
editableAnnotationTypes List of annotation types that are selectable. Passing null or an empty list means that ALL supported annotation types are editable.

public PdfActivityConfiguration.Builder enableAnnotationEditing ()

Enables annotation editing functionality.

public PdfActivityConfiguration.Builder enableAnnotationList ()

Enables the list of annotations.

public PdfActivityConfiguration.Builder enableAnnotationRotation ()

Enables annotation rotation functionality.

public PdfActivityConfiguration.Builder enableBookmarkEditing ()

Enables editing controls on the bookmarks list.

public PdfActivityConfiguration.Builder enableBookmarkList ()

Enables the display of bookmarks.

public PdfActivityConfiguration.Builder enableContentEditing ()

Enables content editing functionality.

public PdfActivityConfiguration.Builder enableCopyPaste ()

Enables copy and paste of annotations.

public PdfActivityConfiguration.Builder enableDocumentEditor ()

Enables document editing functionality in the page grid.

public PdfActivityConfiguration.Builder enableDocumentInfoView ()

Enables the document info view.

public PdfActivityConfiguration.Builder enableFormEditing ()

Enables form editing functionality.

public PdfActivityConfiguration.Builder enableMagnifier (boolean enabled)

Sets whether the magnifier is shown when text selection handles are touched. Defaults to true.

Parameters
enabled true to enable the magnifier, false otherwise.

public PdfActivityConfiguration.Builder enableOutline ()

Enables outline menu in the activity.

public PdfActivityConfiguration.Builder enablePrinting ()

Enables printing option in the menu if applicable for the document and the device.

public PdfActivityConfiguration.Builder enableReaderView (boolean readerViewEnabled)

Sets whether we enable the reader view in the activity or not. It includes also the icon in the main toolbar. It requires the Reader View license to work. Defaults to false.

Parameters
readerViewEnabled true when the reader view should be enabled, false when it should not be enabled.
Throws
InvalidPSPDFKitLicenseException if current license doesn't allow using the reader view.

public PdfActivityConfiguration.Builder enableSearch ()

Enables document search functionality.

public PdfActivityConfiguration.Builder enabledAnnotationTools (List<AnnotationTool> enabledAnnotationTools)

Sets a list of annotation tools that are enabled.

Note: AnnotationTool will be enabled only when its underlying annotation type (toAnnotationType()) is editable (see editableAnnotationTypes(List)) and annotation editing is enabled (see enableAnnotationEditing()).

Parameters
enabledAnnotationTools List of supported annotation tools. Passing null or an empty list means that ALL supported annotation tools are enabled.

public PdfActivityConfiguration.Builder excludedAnnotationTypes (List<AnnotationType> excludedAnnotationTypes)

Sets a list of annotation types that will be excluded from rendering.

Parameters
excludedAnnotationTypes List of annotation types that will be excluded from rendering. Passing an empty list means that ALL supported annotation types are rendered.

public PdfActivityConfiguration.Builder firstPageAlwaysSingle (boolean firstPageAlwaysSingle)

Sets whether the first page should always be displayed as a single or not. This is notable only if double page mode is active.

Parameters
firstPageAlwaysSingle true to always display the first page as a single one, false otherwise.

public PdfActivityConfiguration.Builder fitMode (PageFitMode mode)

Sets the page fit mode. Valid modes are FIT_TO_SCREEN which will try to fit pages into the device's screen, or FIT_TO_WIDTH which will fit the page so that it's width matches the device's screen width.

Parameters
mode Page fit mode from PageFitMode.

public PdfActivityConfiguration.Builder forceSignatureButtonPositionInMainToolbar (boolean forceSignatureButtonPositionInMainToolbar)

Forces the signature button to show up in the main toolbar. The button's visibility in the main toolbar default to false when the license uses Annotation Editing, as normally the annotation signature creation can be accessed via the Annotation Creation Toolbar. For the special case where the license includes Electronic Signatures without Annotation Editing, the signature button will be included in the main toolbar rather than in the Annotation Creation Toolbar. Throws when license does not support using Electronic Signatures.

Parameters
forceSignatureButtonPositionInMainToolbar true to force the signature button position in the main toolbar.
Throws
InvalidPSPDFKitLicenseException if current license doesn't allow creating signature annotations.

public PdfActivityConfiguration.Builder hideDocumentTitleOverlay ()

Hides the overlay displaying the document title.

public PdfActivityConfiguration.Builder hideNavigationButtons ()

Hides the navigation buttons.

public PdfActivityConfiguration.Builder hidePageLabels ()

Hides page labels (if any).

public PdfActivityConfiguration.Builder hidePageNumberOverlay ()

Hides the overlay displaying currently selected page.

public PdfActivityConfiguration.Builder hideSettingsMenu ()

Hides the settings menu icon.

public PdfActivityConfiguration.Builder hideThumbnailGrid ()

Hides the actionbar icon to show grid of thumbnail pages.

public PdfActivityConfiguration.Builder hideUserInterfaceWhenCreatingAnnotations (boolean hideUserInterfaceWhenCreatingAnnotations)

Sets to automatically hide user interface controls when annotation creation toolbar position is in vertical position (left/right). Changing toolbar's position to top restores user interface visibility. This options is valid only for USER_INTERFACE_VIEW_MODE_AUTOMATIC and USER_INTERFACE_VIEW_MODE_AUTOMATIC_BORDER_PAGES.

Parameters
hideUserInterfaceWhenCreatingAnnotations true when user interface should be hidden when showing vertical annotation creation toolbar.

public PdfActivityConfiguration.Builder invertColors (boolean invertColors)

Sets if the colors will be inverted in the document. This is disabled by default.

Parameters
invertColors true if colors should be inverted, false otherwise.

public PdfActivityConfiguration.Builder layout (int layoutRes)

Sets a layoutRes used by the launched activity. When using this, make sure that the selected layout contains all the required views. This defaults to pspdf__pdf_activity.

Parameters
layoutRes Resource identifier of the activity layout.

public PdfActivityConfiguration.Builder layoutMode (PageLayoutMode mode)

Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically).

Parameters
mode Layout mode set with PageLayoutMode.

public PdfActivityConfiguration.Builder listedAnnotationTypes (EnumSet<AnnotationType> listedAnnotationTypes)

Sets the annotation types that should be displayed in the annotation list. By default, all types are displayed except LINK.

Parameters
listedAnnotationTypes Set of types to be displayed in the annotation list.

public PdfActivityConfiguration.Builder loadingProgressDrawable (Integer loadingProgressDrawable)

Sets a drawable for loading progress throbber while document is loaded.

Parameters
loadingProgressDrawable Resource ID of the progress drawable. If set to null, loading throbber will not be displayed.

public PdfActivityConfiguration.Builder maxZoomScale (float scale)

Sets the maximum zoom scale at which the document should be displayed. Make sure this value is higher than defaultZoomScale. Defaults to MAX_ZOOM.

Allowed interval: [1.0, 20.0]

Parameters
scale Scale for the maximum allowed zoom.

public PdfActivityConfiguration.Builder memoryCacheSize (int memoryCacheSize)

Sets size of memory cache for rendered pages and bitmaps. Defaults to 1/4 of available heap size of the app.

Note: Disabling this might lead to severe performance problems.

Parameters
memoryCacheSize Size of memory cache in bytes.

public PdfActivityConfiguration.Builder page (int pageIndex)

Sets the page to start the document at. Default value is 0.

Parameters
pageIndex Page at which the document should initially start (0-indexed).

public PdfActivityConfiguration.Builder pagePadding (int pagePaddingDp)

Sets the padding between pages. Defaults to 16dp.

Parameters
pagePaddingDp padding between pages in density independent pixels (dp).

public PdfActivityConfiguration.Builder redoEnabled (boolean redoEnabled)

Enables or disables redo support. If true we will allow the user to redo changes that were undone before. If false the user will not be able to redo edits. If undo is disabled setting this to true will not do anything.

Parameters
redoEnabled true to enable redo support, or false to disable it.

public PdfActivityConfiguration.Builder restoreLastViewedPage (boolean restoreLastViewedPage)

Enables or disables restoration of the last viewed page when reopening a document. If true, the last viewed page will be restored when opening the document a second time. If false, the document will be opened at page index 0. Defaults to true.

public PdfActivityConfiguration.Builder scrollDirection (PageScrollDirection orientation)

Sets the scrolling direction (i.e. the orientation) for the document. This defaults to HORIZONTAL.

Parameters
orientation Scrolling direction from PageScrollDirection.

public PdfActivityConfiguration.Builder scrollMode (PageScrollMode mode)

Sets the scrolling mode. Currently supported scrolling modes are PER_PAGE (also called paginated scroll mode) which will snap in pages, and CONTINUOUS which will not snap in to pages, but allow to scroll continuously.

Parameters
mode Page scroll mode from PageScrollMode.

public PdfActivityConfiguration.Builder scrollOnEdgeTapEnabled (boolean enabled)

Sets whether taps on the edge of a page scroll to the next / previous page. Defaults to true enabling scrolling by tapping the edge of pages.

Parameters
enabled true to enable scrolling by tapping the edge, false to disable scrolling by tapping the edge.

public PdfActivityConfiguration.Builder scrollOnEdgeTapMargin (int marginDp)

Margin in dp in which taps on the edge of the page will trigger the page navigation. Defaults to 24dp.

Parameters
marginDp The margin in which taps on the edge of the page should trigger page navigation.

public PdfActivityConfiguration.Builder scrollbarsEnabled (boolean scrollbarsEnabled)

Sets the document scrollbars to be enabled or disabled.

Parameters
scrollbarsEnabled true to enable document scrollbars (default), or false to disable them.

public PdfActivityConfiguration.Builder searchConfiguration (SearchConfiguration searchConfiguration)

Sets configuration used for searching, applied to search views.

Parameters
searchConfiguration Configuration to be applied.

public PdfActivityConfiguration.Builder setAnnotationInspectorEnabled (boolean isEnabled)

Sets whether the annotation inspector is enabled. This defaults to true.

Parameters
isEnabled true to enable annotation inspector when creating and editing the annotations.

public PdfActivityConfiguration.Builder setAnnotationListReorderingEnabled (boolean enable)

Sets whether reordering annotations in the annotation list is enabled. This defaults to true.

Parameters
enable true to enable reordering annotations in the annotation list.

public PdfActivityConfiguration.Builder setAnnotationNoteHintingEnabled (boolean isEnabled)

Enables or disables visual indicator shown for annotations that have annotation notes.

Parameters
isEnabled true to enable visual annotation contents hint, false to disable it.

public PdfActivityConfiguration.Builder setDocumentInfoViewSeparated (boolean separated)

The documeninfo view is now by default in a separate window and no longer in the outlineview. If you want to keep the old behaviour with the document info in the outline view, call this method with false

Parameters
separated true if the document info should be displayed in a separate view (and also have an explicit item in the options menu), or false otherwise

public PdfActivityConfiguration.Builder setEnableNoteAnnotationNoZoomHandling (boolean noZoomHandlingEnabled)

Enables or disables handling for NOZOOM flag for note annotations. Note annotations are always displayed as if NOZOOM flag was set by default.

Parameters
noZoomHandlingEnabled If true, note annotations will respect missing NOZOOM flag and will allow zoom in that case.

public PdfActivityConfiguration.Builder setEnabledCopyPasteFeatures (EnumSet<CopyPasteFeatures> enabledFeatures)

Sets the CopyPasteFeatures that are enabled. Defaults to all features being enabled.

public PdfActivityConfiguration.Builder setEnabledShareFeatures (EnumSet<ShareFeatures> enabledShareFeatures)

Configures which share features are enabled in the UI. This feature is only UI specific, defining the available sharing features in the PdfActivity. The sharing API still works even if certain share feature is disabled.

Parameters
enabledShareFeatures Set of share features to enable.

public PdfActivityConfiguration.Builder setJavaScriptEnabled (boolean isEnabled)

Enables or disables JavaScript processing. Defaults to true.

Note: Processing JavaScript can be slow for documents with a large number of document providers or scripts. Disabling in most cases will not have any negative effects.

Parameters
isEnabled true to enable JavaScript processing for loaded documents.

public PdfActivityConfiguration.Builder setMeasurementToolsEnabled (boolean measurementToolsEnabled)

Enables or disables measurement tools functionality.

Parameters
measurementToolsEnabled true to enable measurement tools (if licensed), or false to disable it.

public PdfActivityConfiguration.Builder setMultithreadedRenderingEnabled (boolean isMultithreadedRenderingEnabled)

Sets whether the multithreaded rendering should be enabled. Defaults to true.

Multi-document rendering speeds up page rendering. Disabling it may speed things up if, for example, you know you only have to render single page of the document.

Parameters
isMultithreadedRenderingEnabled true to enable multithreaded rendering, false to disable.

public PdfActivityConfiguration.Builder setRedactionUiEnabled (boolean redactionUiEnabled)

Sets whether we show the UI to apply redactions when there are RedactionAnnotation in the document or not. Defaults to true.

Parameters
redactionUiEnabled true when the redaction UI should be displayed, false if it should not be displayed.

public PdfActivityConfiguration.Builder setResizeGuideLineIntervals (List<Float> intervals)

Sets guide line on/off intervals sizes. Must have an even number of entries (>=2). Even indices are specifying the "on" intervals, the odd indices specifying the "off" intervals. "On" intervals specify length of the line dashes, "Off" specify length of the line gaps.

Parameters
intervals List of ON and OFF distances.

public PdfActivityConfiguration.Builder setResizeGuideSnapAllowance (float snapAllowance)

Sets how aggressively the resize guides works.

Parameters
snapAllowance How many pixels around the guide line will snap to guide when resizing.

public PdfActivityConfiguration.Builder setSearchType (int searchType)

Sets the search type (if search is enabled).

Parameters
searchType Search type to be applied to the document, SEARCH_INLINE or SEARCH_MODULAR.

public PdfActivityConfiguration.Builder setSelectedAnnotationResizeEnabled (boolean enabled)

Enable or disable resizing of selected annotations. This defaults to true.

Parameters
enabled true to enable resizing of selected annotations, or false to disable resizing.

public PdfActivityConfiguration.Builder setSelectedAnnotationResizeGuidesEnabled (boolean enabled)

Enables or disables resize guides. This defaults to true.

Parameters
enabled true to enable resize guides for resizable annotations, or false to disable guides.

public PdfActivityConfiguration.Builder setSelectedFreetextAnnotationFontScalingOnResizeEnabled (boolean enabled)

Enables or disables resize guides. This defaults to true.

Parameters
enabled true to enable resize guides for resizable annotations, or false to disable guides.

public PdfActivityConfiguration.Builder setSettingsMenuItems (EnumSet<SettingsMenuItemType> settingsMenuItemShown)

Sets the items to show in the settings menu. By default all the items are shown. If none are shown the settings menu icon will not be shown either.

Parameters
settingsMenuItemShown Sets the items to show in the settings menu. By default all the items are shown.

public PdfActivityConfiguration.Builder setSignaturePickerOrientation (SignaturePickerOrientation orientation)

Sets the orientation to use for the signature picker. Defaults to AUTOMATIC.

Parameters
orientation The orientation to use for the signature picker.

public PdfActivityConfiguration.Builder setTabBarHidingMode (TabBarHidingMode tabBarHidingMode)

Configures the tab bar hiding mode.

Parameters
tabBarHidingMode Mode governing PdfTabBar hiding policy.

public PdfActivityConfiguration.Builder setThumbnailBarMode (ThumbnailBarMode thumbnailBarMode)

Sets the thumbnail bar mode.

Parameters
thumbnailBarMode Thumbnail bar mode to be set on the activity.

public PdfActivityConfiguration.Builder setUserInterfaceViewMode (UserInterfaceViewMode userInterfaceViewMode)

Sets the user interface view mode.

Parameters
userInterfaceViewMode user interface view mode to be set on the activity.

public PdfActivityConfiguration.Builder setVolumeButtonsNavigationEnabled (boolean isVolumeButtonsNavigationEnabled)

Enables or disables volume buttons navigation. This is disabled by default.

Parameters
isVolumeButtonsNavigationEnabled true to enable navigation using volume buttons, or false to disable it.

public PdfActivityConfiguration.Builder showDocumentTitleOverlay ()

Shows overlay displaying the document title.

public PdfActivityConfiguration.Builder showGapBetweenPages (boolean showGapBetweenPages)

Sets whether to show gao between pages in double page mode or not.

Parameters
showGapBetweenPages If true, there will be a gap between pages in double page mode, if false the pages will be joined.

public PdfActivityConfiguration.Builder showNavigationButtons ()

Shows the navigation buttons.

public PdfActivityConfiguration.Builder showPageLabels ()

Enables display of the page labels (if any).

public PdfActivityConfiguration.Builder showPageNumberOverlay ()

Shows overlay displaying current page number over document.

public PdfActivityConfiguration.Builder showSettingsMenu ()

Shows the settings menu icon.

public PdfActivityConfiguration.Builder showSignHereOverlay (boolean showOverlay)

Sets whether the sign here overlay is shown inside of signature form fields. Defaults to true.

Parameters
showOverlay true to show the sign here overlay in signature form fields, false to hide it.

public PdfActivityConfiguration.Builder showThumbnailGrid ()

Displays an actionbar icon to show grid of thumbnail pages.

public PdfActivityConfiguration.Builder signatureAppearance (SignatureAppearance signatureAppearance)

Defines the appearance of the digital signature that is added after digitally signing a document. Things to configure include the graphic to use for the signature or whether the time of signing should be shown. For the full list of properties check SignatureAppearance.

Parameters
signatureAppearance The signature appearance to use or null to use the default appearance.

public PdfActivityConfiguration.Builder signatureCertificateSelectionMode (SignatureCertificateSelectionMode signatureCertificateSelectionMode)

Defines if the user should be able to select certificates for digitally signing a document, when creating a new signature. Defaults to IF_AVAILABLE.

Parameters
signatureCertificateSelectionMode Signature certificate selection mode to be used.

public PdfActivityConfiguration.Builder signatureColorOptions (SignatureColorOptions signatureColorOptions)

Defines the 3 signature color options available when using the Electronic Signatures "Draw" or "Type" signing UI. Defaults to black, purple, and blue.

Parameters
signatureColorOptions Can be created from @ColorRes or @ColorInt with fromColorRes(int, int, int) and fromColorInt(int, int, int) respectively.

public PdfActivityConfiguration.Builder signatureCreationModes (List<SignatureCreationMode> signatureCreationModes)

The ways in which the user can choose to add their signature. These are shown in the order specified as tabs across the top of the signatures UI. The first entry will be selected initially. If this array contains a single entry then the tabs will be hidden. This array must not be empty and must not contain duplicates.

Parameters
signatureCreationModes An array of SignatureCreationMode. Must have at least one mode and not contain duplicates.

public PdfActivityConfiguration.Builder signatureSavingStrategy (SignatureSavingStrategy signatureSavingStrategy)

Signature saving strategy used within the dialog when adding signatures. Defaults to SAVE_IF_SELECTED. This will only work if a SignatureStorage has been created and set via setSignatureStorage(SignatureStorage), otherwise NEVER_SAVE will be used.

Parameters
signatureSavingStrategy Signature strategy to apply to saving signatures.

public PdfActivityConfiguration.Builder startZoomScale (float startZoomScale)

Sets the start scale at which the document will be displayed. Defaults to DEFAULT_ZOOM.

Parameters
startZoomScale Starting zoom scale factor.

public PdfActivityConfiguration.Builder textSelectionEnabled (boolean isTextSelectionEnabled)

Enables or disables text selection (both programmatically and via long-press gesture). This is enabled by default.

Parameters
isTextSelectionEnabled true to enable text selection, or false to disable it.

public PdfActivityConfiguration.Builder textSelectionPopupToolbarEnabled (boolean enabled)

Sets whether the text selection popup toolbar is enabled or not. If disabled, and this configuration is used within your PdfActivity, the old text selection toolbar will be used.

Parameters
enabled true to enable it, false otherwise.

public PdfActivityConfiguration.Builder theme (int themeRes)

Sets a themeRes used to override default activity theme.

Parameters
themeRes Theme resource id used by the launched activity.

public PdfActivityConfiguration.Builder themeDark (int themeDarkRes)

Sets a themeDarkRes used to override dark activity theme.

Parameters
themeDarkRes Theme resource id used by the launched activity in dark mode.

public PdfActivityConfiguration.Builder themeMode (ThemeMode mode)

Sets the app theme mode. Night mode automatically inverts colors.

Parameters
mode Theme mode set with ThemeMode.

public PdfActivityConfiguration.Builder title (String title)

Sets the actionbar activity title. If not set (or null), PSPDFKit will extract the title from the loaded PDF document.

Parameters
title Activity title string, or null to use automated title extraction.

public PdfActivityConfiguration.Builder toGrayscale (boolean toGrayscale)

Sets if the colors will be converted to grayscale. This is disabled by default.

Parameters
toGrayscale true if page should be rendered in grayscale, false otherwise.

public PdfActivityConfiguration.Builder undoEnabled (boolean undoEnabled)

Enables or disables undo support. If true we will keep track of edits to the document and allow the user to undo actions. If false the user will not be able to undo edits and redo will also be disabled.

Parameters
undoEnabled true to enable undo support, or false to disable it.

public PdfActivityConfiguration.Builder useImmersiveMode (boolean useImmersiveMode)

Enabled immersive fullscreen mode in the activity. Note that this feature is only natively supported from Android 4.4 and newer, before that a FullScreen theme will have to be applied to PSPDFKit activity. This defaults to false.

Parameters
useImmersiveMode true for activating immersive mode, or false to deactivate it.

public PdfActivityConfiguration.Builder videoPlaybackEnabled (boolean videoPlaybackEnabled)

Enables or disables video playback. This is disabled by default.

Parameters
videoPlaybackEnabled true if video playback is enabled, false otherwise.

public PdfActivityConfiguration.Builder zoomOutBounce (boolean zoomOutBounce)

Should the zoom out below the minimum zoom have a bounce-back effect on a page.

Parameters
zoomOutBounce true if should have a zoom-out bounce effect, false otherwise.