public static final class

PdfConfiguration.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.configuration.PdfConfiguration.Builder

Class Overview

Builder used to construct PdfConfiguration instance.

Summary

Public Constructors
Builder()
Creates a new PdfConfiguration builder.
Builder(PdfConfiguration configuration)
Create a new builder from existing configuration.
Public Methods
PdfConfiguration.Builder allowMultipleBookmarksPerPage(boolean allowed)
Sets whether multiple bookmarks per page can be added or not.
PdfConfiguration.Builder animateScrollOnEdgeTaps(boolean enabled)
Sets whether page changes triggered by tapping the page edge cause an animation.
PdfConfiguration.Builder annotationReplyFeatures(AnnotationReplyFeatures annotationReplyFeatures)
Configures which part of the annotation replies UI is enabled.
PdfConfiguration.Builder automaticallyGenerateLinks(boolean automaticallyGenerateLinks)
Enables or disables automatic link generation.
PdfConfiguration.Builder autosaveEnabled(boolean isAutosaveEnabled)
Enables or disables auto-saving of PDF document changes.
PdfConfiguration.Builder backgroundColor(int backgroundColor)
Sets color of PDF background.
PdfConfiguration build()
Creates a @{link PdfConfiguration} with the arguments supplied to this builder.
PdfConfiguration.Builder defaultSigner(String signerIdentifier)
Defines the default signer to be selected when signing a document.
PdfConfiguration.Builder disableAnnotationEditing()
Disables annotation editing functionality.
PdfConfiguration.Builder disableAnnotationLimitedToPageBounds()
Disables the page bounds limit imposed when dragging annotations.
PdfConfiguration.Builder disableAnnotationRotation()
Disables annotation rotation functionality.
PdfConfiguration.Builder disableAutoSelectNextFormElement()
Disables functionality that automatically selects next form element.
PdfConfiguration.Builder disableCopyPaste()
Disables copy and paste of annotations.
PdfConfiguration.Builder disableFormEditing()
Disables form editing functionality.
PdfConfiguration.Builder editableAnnotationTypes(List<AnnotationType> editableAnnotationTypes)
Sets a list of annotation types that can be selected on page and edited.
PdfConfiguration.Builder enableAnnotationEditing()
Enables annotation editing functionality.
PdfConfiguration.Builder enableAnnotationRotation()
Enables annotation rotation functionality.
PdfConfiguration.Builder enableAutoSelectNextFormElement()
Enables functionality that automatically selects next form element.
PdfConfiguration.Builder enableCopyPaste()
Enables copy and paste of annotations.
PdfConfiguration.Builder enableFormEditing()
Enables form editing functionality.
PdfConfiguration.Builder enableMagnifier(boolean enabled)
Sets whether the magnifier is shown when text selection handles are touched.
PdfConfiguration.Builder enabledAnnotationTools(List<AnnotationTool> enabledAnnotationTools)
Sets a list of annotation tools that are enabled.
PdfConfiguration.Builder excludedAnnotationTypes(List<AnnotationType> excludedAnnotationTypes)
Sets a list of annotation types that will be excluded from rendering.
PdfConfiguration.Builder firstPageAlwaysSingle(boolean firstPageAlwaysSingle)
Sets whether the first page should always be displayed as a single or not.
PdfConfiguration.Builder fitMode(PageFitMode mode)
Sets the page fit mode, or how the screen should fit the document.
PdfConfiguration.Builder invertColors(boolean invertColors)
Sets if the colors will be inverted in the document.
PdfConfiguration.Builder layoutMode(PageLayoutMode mode)
Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically).
PdfConfiguration.Builder loadingProgressDrawable(Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded.
PdfConfiguration.Builder maxZoomScale(float scale)
Sets the maximum zoom scale at which the document should be displayed.
PdfConfiguration.Builder memoryCacheSize(int memoryCacheSize)
Sets the size of memory cache for rendered pages and bitmaps.
PdfConfiguration.Builder pagePadding(int pagePaddingDp)
Sets the padding between pages.
PdfConfiguration.Builder playingMultipleMediaInstancesEnabled(boolean playingMultipleMediaInstancesEnabled)
Sets whether playing multiple media instances is enabled or not.
PdfConfiguration.Builder redoEnabled(boolean redoEnabled)
Enables or disables redo support.
PdfConfiguration.Builder restoreLastViewedPage(boolean restoreLastViewedPage)
Enables or disables restoration of the last viewed page when reopening a document.
PdfConfiguration.Builder scrollDirection(PageScrollDirection orientation)
Sets scrolling direction for the document.
PdfConfiguration.Builder scrollMode(PageScrollMode mode)
Sets the page scrolling mode - if the scrolling position will always snap to page or not.
PdfConfiguration.Builder scrollOnEdgeTapEnabled(boolean enabled)
Sets whether taps on the edge of a page scroll to the next / previous page.
PdfConfiguration.Builder scrollOnEdgeTapMargin(int marginDp)
Margin in dp in which taps on the edge of the page will trigger the page navigation.
PdfConfiguration.Builder scrollbarsEnabled(boolean scrollbarsEnabled)
Sets the document scrollbars to be enabled or disabled.
PdfConfiguration.Builder setAnnotationInspectorEnabled(boolean isEnabled)
Sets whether the annotation inspector is enabled.
PdfConfiguration.Builder setEnableNoteAnnotationNoZoomHandling(boolean noZoomHandlingEnabled)
Enables or disables handling for NOZOOM flag for note annotations.
PdfConfiguration.Builder setEnabledCopyPasteFeatures(EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the CopyPasteFeatures that are enabled.
PdfConfiguration.Builder setEnabledShareFeatures(EnumSet<ShareFeatures> enabledShareFeatures)
Configures which share features are enabled in the UI.
PdfConfiguration.Builder setFixedLowResRenderPixelCount(Integer fixedLowResRenderPixelCount)
Sets the number of pixels in low resolution renderings to a fixed size.
PdfConfiguration.Builder setJavaScriptEnabled(boolean isEnabled)
Enables or disables JavaScript processing.
PdfConfiguration.Builder setMeasurementToolsEnabled(boolean measurementToolsEnabled)
Enables or disables measurement tools functionality.
PdfConfiguration.Builder setMinimumAnnotationSize(Class<? extends ResizableAnnotation> annotationType, Size size)
Sets the minimum annotation size for all annotations of the given type in PDF points.
PdfConfiguration.Builder setMultithreadedRenderingEnabled(boolean isMultithreadedRenderingEnabled)
Sets whether the multithreaded rendering should be enabled.
PdfConfiguration.Builder setResizeGuideLineIntervals(List<Float> intervals)
Sets guide line on/off intervals sizes.
PdfConfiguration.Builder setResizeGuideSnapAllowance(float snapAllowance)
Sets how aggressively the resize guides works.
PdfConfiguration.Builder setSelectedAnnotationFontScalingOnResizeEnabled(boolean enabled)
Enables or disables font scaling for Freetext annotations when resizing with the bottom right resize handle.
PdfConfiguration.Builder setSelectedAnnotationResizeEnabled(boolean enabled)
Enable or disable resizing of selected annotations.
PdfConfiguration.Builder setSelectedAnnotationResizeGuidesEnabled(boolean enabled)
Enables or disables resize guides.
PdfConfiguration.Builder setSignaturePickerOrientation(SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker.
PdfConfiguration.Builder showGapBetweenPages(boolean showGapBetweenPages)
Sets whether to show gao between pages in double page mode or not.
PdfConfiguration.Builder showSignHereOverlay(boolean showOverlay)
Sets whether the sign here overlay is shown inside of signature form fields.
PdfConfiguration.Builder signatureAppearance(SignatureAppearance signatureAppearance)
Defines the appearance of the digital signature that is added after digitally signing a document.
PdfConfiguration.Builder signatureCertificateSelectionMode(SignatureCertificateSelectionMode signatureCertificateSelectionMode)
Defines if the user should be able to select certificates for digitally signing a document, when creating a new signature.
PdfConfiguration.Builder signatureColorOptions(SignatureColorOptions signatureColorOptions)
Defines the 3 signature color options available when using the Electronic Signatures "Draw" or "Type" signing UI.
PdfConfiguration.Builder signatureCreationModes(List<SignatureCreationMode> signatureCreationModes)
The ways in which the user can choose to add their signature.
PdfConfiguration.Builder signatureSavingStrategy(SignatureSavingStrategy signatureSavingStrategy)
Defines if a signature should be saved after creation.
PdfConfiguration.Builder startZoomScale(float startZoomScale)
Sets the start scale at which the document will be displayed.
PdfConfiguration.Builder textSelectionEnabled(boolean isTextSelectionEnabled)
Enables or disables text selection (both programmatically and via long-press gesture).
PdfConfiguration.Builder textSelectionPopupToolbarEnabled(boolean enabled)
Sets whether the text selection popup toolbar is enabled or not.
PdfConfiguration.Builder themeMode(ThemeMode mode)
Sets the app theme mode.
PdfConfiguration.Builder toGrayscale(boolean toGrayscale)
Sets if the colors will be converted to grayscale.
PdfConfiguration.Builder undoEnabled(boolean undoEnabled)
Enables or disables undo support.
PdfConfiguration.Builder videoPlaybackEnabled(boolean videoPlaybackEnabled)
Enables or disables video playback.
PdfConfiguration.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 ()

Creates a new PdfConfiguration builder.

public Builder (PdfConfiguration configuration)

Create a new builder from existing configuration.

Parameters
configuration PdfConfiguration used to initialized builder.

Public Methods

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder autosaveEnabled (boolean isAutosaveEnabled)

Enables or disables auto-saving of PDF document changes. This is enabled by default.

Parameters
isAutosaveEnabled true to enable autosave in onStop() of the document fragment, false otherwise.

public PdfConfiguration.Builder backgroundColor (int backgroundColor)

Sets color of PDF background. White by default.

Parameters
backgroundColor Paper color in integer format.

public PdfConfiguration build ()

Creates a @{link PdfConfiguration} with the arguments supplied to this builder.

Returns
  • Newly created configuration.

public PdfConfiguration.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 PdfConfiguration.Builder disableAnnotationEditing ()

Disables annotation editing functionality.

public PdfConfiguration.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 PdfConfiguration.Builder disableAnnotationRotation ()

Disables annotation rotation functionality.

public PdfConfiguration.Builder disableAutoSelectNextFormElement ()

Disables functionality that automatically selects next form element. Disabled by default.

public PdfConfiguration.Builder disableCopyPaste ()

Disables copy and paste of annotations.

public PdfConfiguration.Builder disableFormEditing ()

Disables form editing functionality.

public PdfConfiguration.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 PdfConfiguration.Builder enableAnnotationEditing ()

Enables annotation editing functionality.

public PdfConfiguration.Builder enableAnnotationRotation ()

Enables annotation rotation functionality.

public PdfConfiguration.Builder enableAutoSelectNextFormElement ()

Enables functionality that automatically selects next form element. Disabled by default.

public PdfConfiguration.Builder enableCopyPaste ()

Enables copy and paste of annotations.

public PdfConfiguration.Builder enableFormEditing ()

Enables form editing functionality.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder fitMode (PageFitMode mode)

Sets the page fit mode, or how the screen should fit the document. Default is fit-to-page.

Parameters
mode Fit mode set with PageFitMode.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder maxZoomScale (float scale)

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

Default value: {@value PdfFragment#MAX_ZOOM}.

Allowed interval: [1.0, 20.0]

Parameters
scale Maximum zoom scale factor.

public PdfConfiguration.Builder memoryCacheSize (int memoryCacheSize)

Sets the size of memory cache for rendered pages and bitmaps. It defaults to 1/4 of available heap size of the app. Note that disabling this might lead to severe performance problems.

Parameters
memoryCacheSize Size of memory cache in bytes.

public PdfConfiguration.Builder pagePadding (int pagePaddingDp)

Sets the padding between pages. Defaults to 16dp.

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

public PdfConfiguration.Builder playingMultipleMediaInstancesEnabled (boolean playingMultipleMediaInstancesEnabled)

Sets whether playing multiple media instances is enabled or not. This is disabled by default.

Parameters
playingMultipleMediaInstancesEnabled true to enabled playing multiple media instances, false to only play one at a time.

public PdfConfiguration.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 PdfConfiguration.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.

Parameters
restoreLastViewedPage true to enable restoration of the last viewed page, or false to disable it.

public PdfConfiguration.Builder scrollDirection (PageScrollDirection orientation)

Sets scrolling direction for the document.

Parameters
orientation Scrolling direction set with PageScrollDirection.

public PdfConfiguration.Builder scrollMode (PageScrollMode mode)

Sets the page scrolling mode - if the scrolling position will always snap to page or not.

Parameters
mode Scrolling mode set with PageScrollMode.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder setEnabledCopyPasteFeatures (EnumSet<CopyPasteFeatures> enabledFeatures)

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

public PdfConfiguration.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 PdfFragment. The sharing API still works even if a specific share feature is disabled.

Parameters
enabledShareFeatures Set of share features to enable.

public PdfConfiguration.Builder setFixedLowResRenderPixelCount (Integer fixedLowResRenderPixelCount)

Sets the number of pixels in low resolution renderings to a fixed size. By default, the size (i.e. the resolution) of low-res page renderings inside the PdfFragment will be set to an optimized pixel count, based on the device specs and performance. Using this method, you can override the default and set it to a fixed value.

Parameters
fixedLowResRenderPixelCount Fixed low resolution pixel count, may be null.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder setMinimumAnnotationSize (Class<? extends ResizableAnnotation> annotationType, Size size)

Sets the minimum annotation size for all annotations of the given type in PDF points.

Parameters
annotationType The ResizableAnnotation type whose minimum size is being set.
size The minimum annotation size to replace the default minimum size.

public PdfConfiguration.Builder setMultithreadedRenderingEnabled (boolean isMultithreadedRenderingEnabled)

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

Multithreaded 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 PdfConfiguration.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. Defaults to [5f, 20f].

Parameters
intervals List of ON and OFF distances.

public PdfConfiguration.Builder setResizeGuideSnapAllowance (float snapAllowance)

Sets how aggressively the resize guides works. Defaults to 30.0f.

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

public PdfConfiguration.Builder setSelectedAnnotationFontScalingOnResizeEnabled (boolean enabled)

Enables or disables font scaling for Freetext annotations when resizing with the bottom right resize handle. This defaults to true.

Parameters
enabled true to enable font scaling, or false to disable it.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.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 values. Must have at least one mode and not contain duplicates.

public PdfConfiguration.Builder signatureSavingStrategy (SignatureSavingStrategy signatureSavingStrategy)

Defines if a signature should be saved after creation. When the Electronic Signature component is available, saving defaults to NEVER_SAVE. If the license used is on Legacy Signatures, the property will default to SAVE_IF_SELECTED. If not set to NEVER_SAVE then a storage database must be passed to setSignatureStorage(SignatureStorage).

Parameters
signatureSavingStrategy Signature strategy to apply to saving signatures.

public PdfConfiguration.Builder startZoomScale (float startZoomScale)

Sets the start scale at which the document will be displayed.

Default value: {@value PdfFragment#DEFAULT_ZOOM}

Parameters
startZoomScale Starting zoom scale factor.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder themeMode (ThemeMode mode)

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

Parameters
mode Theme mode set with ThemeMode.

public PdfConfiguration.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 PdfConfiguration.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 PdfConfiguration.Builder videoPlaybackEnabled (boolean videoPlaybackEnabled)

Enables or disables video playback. By default, video playback would be disabled unless the device is deemed secure, meaning the device is running at least Android Marshmallow (API 23+) with security patch dating Feb 1st, 2016 or newer.

Feb 1st, 2016 patch fixes a Critical security vulnerability that could enable remote code execution on an affected device through multiple methods such as email, web browsing, and MMS when processing media files.

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

public PdfConfiguration.Builder zoomOutBounce (boolean zoomOutBounce)

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

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