Class PdfActivityConfiguration.Builder
-
- All Implemented Interfaces:
public final class PdfActivityConfiguration.Builder
Builder used to construct PdfActivityConfiguration instance.
-
-
Constructor Summary
Constructors Constructor Description PdfActivityConfiguration.Builder(Context context)
Creates a new com.pspdfkit.ui.PdfActivity configuration builder. PdfActivityConfiguration.Builder(PdfActivityConfiguration configuration)
Create a new builder from existing configuration.
-
Method Summary
Modifier and Type Method Description final PdfActivityConfiguration.Builder
configuration(PdfConfiguration configuration)
Replaces all properties from the PdfConfiguration final PdfActivityConfiguration.Builder
title(String title)
Sets the actionbar activity title. final PdfActivityConfiguration.Builder
layout(@LayoutRes() Integer layoutRes)
Sets a layoutRes
used by the launched activity.final PdfActivityConfiguration.Builder
theme(@StyleRes() Integer themeRes)
Sets a themeRes
used to override default activity theme.final PdfActivityConfiguration.Builder
themeDark(@StyleRes() Integer themeDarkRes)
Sets a themeDarkRes
used to override dark activity theme.final PdfActivityConfiguration.Builder
scrollDirection(PageScrollDirection orientation)
Sets the scrolling direction (i.e. final PdfActivityConfiguration.Builder
scrollMode(PageScrollMode mode)
Sets the scrolling mode. final PdfActivityConfiguration.Builder
forceSignatureButtonPositionInMainToolbar(Boolean forceSignatureButtonPositionInMainToolbar)
Forces the signature button to show up in the main toolbar. final 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). final PdfActivityConfiguration.Builder
themeMode(ThemeMode mode)
Sets the app theme mode. final PdfActivityConfiguration.Builder
firstPageAlwaysSingle(Boolean firstPageAlwaysSingle)
Sets whether the first page should always be displayed as a single or not. final PdfActivityConfiguration.Builder
showGapBetweenPages(Boolean showGapBetweenPages)
Sets whether to show gao between pages in double page mode or not. final PdfActivityConfiguration.Builder
fitMode(PageFitMode mode)
Sets the page fit mode. final PdfActivityConfiguration.Builder
scrollbarsEnabled(Boolean scrollbarsEnabled)
Sets the document scrollbars to be enabled or disabled. final PdfActivityConfiguration.Builder
invertColors(Boolean invertColors)
Sets if the colors will be inverted in the document. final PdfActivityConfiguration.Builder
toGrayscale(Boolean toGrayscale)
Sets if the colors will be converted to grayscale. final PdfActivityConfiguration.Builder
autosaveEnabled(Boolean isAutosaveEnabled)
Enables or disables autosaving of modified PDF documents. final PdfActivityConfiguration.Builder
pagePadding(Integer pagePaddingDp)
Sets the padding between pages. final PdfActivityConfiguration.Builder
restoreLastViewedPage(Boolean restoreLastViewedPage)
Enables or disables restoration of the last viewed page when reopening a document. final PdfActivityConfiguration.Builder
automaticallyGenerateLinks(Boolean automaticallyGenerateLinks)
Enables or disables automatic link generation. final PdfActivityConfiguration.Builder
copyPastEnabled(Boolean enable)
Enable/disable copy and paste of annotations. final PdfActivityConfiguration.Builder
enableCopyPaste()
Enables copy and paste of annotations. final PdfActivityConfiguration.Builder
disableCopyPaste()
Disables copy and paste of annotations. final PdfActivityConfiguration.Builder
setEnabledCopyPasteFeatures(EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the CopyPasteFeatures that are enabled. final PdfActivityConfiguration.Builder
undoEnabled(Boolean undoEnabled)
Enables or disables undo support. final PdfActivityConfiguration.Builder
redoEnabled(Boolean redoEnabled)
Enables or disables redo support. final PdfActivityConfiguration.Builder
setSignaturePickerOrientation(SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker. final PdfActivityConfiguration.Builder
signatureSavingStrategy(SignatureSavingStrategy signatureSavingStrategy)
Signature saving strategy used within the dialog when adding signatures. final PdfActivityConfiguration.Builder
signatureColorOptions(SignatureColorOptions signatureColorOptions)
Defines the 3 signature color options available when using the Electronic Signatures "Draw" or "Type" signing UI. final PdfActivityConfiguration.Builder
signatureCreationModes(@Size(min = 1, max = 3) List<SignatureCreationMode> signatureCreationModes)
The ways in which the user can choose to add their signature. final PdfActivityConfiguration.Builder
annotationReplyFeatures(AnnotationReplyFeatures annotationReplyFeatures)
Configures which part of the annotation replies UI is enabled. final PdfActivityConfiguration.Builder
backgroundColor(@ColorInt() Integer backgroundColor)
Sets color of PDF background. final PdfActivityConfiguration.Builder
loadingProgressDrawable(@DrawableRes() Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded. final PdfActivityConfiguration.Builder
memoryCacheSize(Integer memoryCacheSize)
Sets size of memory cache for rendered pages and bitmaps. final PdfActivityConfiguration.Builder
setDocumentInfoViewSeparated(Boolean separated)
The documeninfo view is now by default in a separate window and no longer in the outlineview. final PdfActivityConfiguration.Builder
documentInfoViewEnabled(Boolean enable)
Enable/disable document info view. final PdfActivityConfiguration.Builder
enableDocumentInfoView()
Enables the document info view. final PdfActivityConfiguration.Builder
disableDocumentInfoView()
Disables the document info view. final PdfActivityConfiguration.Builder
useImmersiveMode(Boolean useImmersiveMode)
Enabled immersive fullscreen mode in the activity. final PdfActivityConfiguration.Builder
pageNumberOverlayEnabled(Boolean enable)
Show/hide the overlay displaying currently selected page. final PdfActivityConfiguration.Builder
hidePageNumberOverlay()
Hides the overlay displaying currently selected page. final PdfActivityConfiguration.Builder
showPageNumberOverlay()
Shows overlay displaying current page number over document. final PdfActivityConfiguration.Builder
pageLabelsEnabled(Boolean enable)
Show/hide page labels (if any). final PdfActivityConfiguration.Builder
hidePageLabels()
Hides page labels (if any). final PdfActivityConfiguration.Builder
showPageLabels()
Enables display of the page labels (if any). final PdfActivityConfiguration.Builder
documentTitleOverlayEnabled(Boolean enable)
Show/hide document title. final PdfActivityConfiguration.Builder
hideDocumentTitleOverlay()
Hides the overlay displaying the document title. final PdfActivityConfiguration.Builder
showDocumentTitleOverlay()
Shows overlay displaying the document title. final PdfActivityConfiguration.Builder
navigationButtonsEnabled(Boolean enable)
Show/hide the navigation buttons. final PdfActivityConfiguration.Builder
hideNavigationButtons()
Hides the navigation buttons. final PdfActivityConfiguration.Builder
showNavigationButtons()
Shows the navigation buttons. final PdfActivityConfiguration.Builder
settingsMenuEnabled(Boolean enable)
Show/hide the settings menu icon. final PdfActivityConfiguration.Builder
hideSettingsMenu()
Hides the settings menu icon. final PdfActivityConfiguration.Builder
showSettingsMenu()
Shows the settings menu icon. final PdfActivityConfiguration.Builder
setSettingsMenuItems(EnumSet<SettingsMenuItemType> settingsMenuItemShown)
Sets the items to show in the settings menu. final PdfActivityConfiguration.Builder
setThumbnailBarMode(ThumbnailBarMode thumbnailBarMode)
Sets the thumbnail bar mode. final PdfActivityConfiguration.Builder
thumbnailGridEnabled(Boolean enable)
Show/hide the actionbar icon to show grid of thumbnail pages. final PdfActivityConfiguration.Builder
showThumbnailGrid()
Displays an actionbar icon to show grid of thumbnail pages. final PdfActivityConfiguration.Builder
hideThumbnailGrid()
Hides the actionbar icon to show grid of thumbnail pages. final PdfActivityConfiguration.Builder
documentEditorEnabled(Boolean enable)
Enable/disable document editing functionality in the page grid. final PdfActivityConfiguration.Builder
disableDocumentEditor()
Disables document editing functionality in the page grid. final PdfActivityConfiguration.Builder
enableDocumentEditor()
Enables document editing functionality in the page grid. final PdfActivityConfiguration.Builder
searchEnabled(Boolean enable)
Enable/disable document search functionality. final PdfActivityConfiguration.Builder
enableSearch()
Enables document search functionality. final PdfActivityConfiguration.Builder
disableSearch()
Disables document search functionality. final PdfActivityConfiguration.Builder
printingEnabled(Boolean enable)
Enable/disable printing option in the menu if applicable for the document and the device. final PdfActivityConfiguration.Builder
enablePrinting()
Enables printing option in the menu if applicable for the document and the device. final PdfActivityConfiguration.Builder
disablePrinting()
Hides printing option in the sharing menu even if printing can be done on the device. final PdfActivityConfiguration.Builder
annotationListEnabled(Boolean enable)
Enable/disable the list of annotations. final PdfActivityConfiguration.Builder
enableAnnotationList()
Enables the list of annotations. final PdfActivityConfiguration.Builder
disableAnnotationList()
Disables the list of annotations. final PdfActivityConfiguration.Builder
defaultToolbarEnabled(Boolean enable)
Enable/disable default toolbar. final PdfActivityConfiguration.Builder
enableDefaultToolbar()
Enables default toolbar. final PdfActivityConfiguration.Builder
disableDefaultToolbar()
Disables default toolbar. final PdfActivityConfiguration.Builder
annotationListReorderingEnabled(Boolean enable)
Sets whether reordering annotations in the annotation list is enabled. final PdfActivityConfiguration.Builder
listedAnnotationTypes(EnumSet<AnnotationType> listedAnnotationTypes)
Sets the annotation types that should be displayed in the annotation list. final PdfActivityConfiguration.Builder
bookmarkListEnabled(Boolean enable)
Enable/disable the display of bookmarks. final PdfActivityConfiguration.Builder
enableBookmarkList()
Enables the display of bookmarks. final PdfActivityConfiguration.Builder
disableBookmarkList()
Disables the display of bookmarks. final PdfActivityConfiguration.Builder
bookmarkEditingEnabled(Boolean enable)
Enable/disable editing controls on the bookmarks list. final PdfActivityConfiguration.Builder
enableBookmarkEditing()
Enables editing controls on the bookmarks list. final PdfActivityConfiguration.Builder
disableBookmarkEditing()
Disabled editing controls on the bookmarks list. final PdfActivityConfiguration.Builder
outlineEnabled(Boolean enable)
Enable/disable outline menu in the activity. final PdfActivityConfiguration.Builder
enableOutline()
Enables outline menu in the activity. final PdfActivityConfiguration.Builder
disableOutline()
Disables outline menu in the activity. final PdfActivityConfiguration.Builder
embeddedFilesViewEnabled(Boolean enable)
Enables the embedded files menu in the activity. final PdfActivityConfiguration.Builder
enableEmbeddedFilesView()
Enables the embedded files menu in the activity. final PdfActivityConfiguration.Builder
disableEmbeddedFilesView()
Disables the embedded files menu in the activity. final PdfActivityConfiguration.Builder
setEnabledShareFeatures(EnumSet<ShareFeatures> enabledShareFeatures)
Configures which share features are enabled in the UI. final PdfActivityConfiguration.Builder
formEditingEnabled(Boolean enable)
Enable/disable form editing functionality. final PdfActivityConfiguration.Builder
enableFormEditing()
Enables form editing functionality. final PdfActivityConfiguration.Builder
disableFormEditing()
Disables form editing functionality. final PdfActivityConfiguration.Builder
annotationEditingEnabled(Boolean enable)
Enable/disable annotation editing functionality. final PdfActivityConfiguration.Builder
enableAnnotationEditing()
Enables annotation editing functionality. final PdfActivityConfiguration.Builder
disableAnnotationEditing()
Disables annotation editing functionality. final PdfActivityConfiguration.Builder
annotationRotationEnabled(Boolean enable)
Enable/disable annotation rotation functionality. final PdfActivityConfiguration.Builder
enableAnnotationRotation()
Enables annotation rotation functionality. final PdfActivityConfiguration.Builder
disableAnnotationRotation()
Disables annotation rotation functionality. final PdfActivityConfiguration.Builder
contentEditingEnabled(Boolean enable)
Enable/disable content editing functionality. final PdfActivityConfiguration.Builder
enableContentEditing()
Enables content editing functionality. final PdfActivityConfiguration.Builder
disableContentEditing()
Disables content editing functionality. final PdfActivityConfiguration.Builder
editableAnnotationTypes(List<AnnotationType> editableAnnotationTypes)
Sets a list of annotation types that can be selected on page and edited. final PdfActivityConfiguration.Builder
enabledAnnotationTools(List<AnnotationTool> enabledAnnotationTools)
Sets a list of annotation tools that are enabled. final PdfActivityConfiguration.Builder
setSelectedAnnotationResizeEnabled(Boolean enabled)
Enable or disable resizing of selected annotations. final PdfActivityConfiguration.Builder
selectedAnnotationResizeGuidesEnabled(Boolean enabled)
Enables or disables resize guides. final PdfActivityConfiguration.Builder
selectedFreetextAnnotationFontScalingOnResizeEnabled(Boolean enabled)
Enables or disables font scaling. final PdfActivityConfiguration.Builder
setResizeGuideSnapAllowance(@FloatRange(from = 0.0) Float snapAllowance)
Sets how aggressively the resize guides works. final PdfActivityConfiguration.Builder
setResizeGuideLineIntervals(@Size(min = 2, multiple = 2) List<Float> intervals)
Sets guide line on/off intervals sizes. final PdfActivityConfiguration.Builder
setAnnotationInspectorEnabled(Boolean isEnabled)
Sets whether the annotation inspector is enabled. final PdfActivityConfiguration.Builder
setAnnotationNoteHintingEnabled(Boolean isEnabled)
Enables or disables visual indicator shown for annotations that have annotation notes. final PdfActivityConfiguration.Builder
setSearchType(SearchType searchType)
Sets the search type (if search is enabled). final PdfActivityConfiguration.Builder
setUserInterfaceViewMode(UserInterfaceViewMode userInterfaceViewMode)
Sets the user interface view mode. final PdfActivityConfiguration.Builder
hideUserInterfaceWhenCreatingAnnotations(Boolean hideUserInterfaceWhenCreatingAnnotations)
Sets to automatically hide user interface controls when annotation creation toolbar position is in vertical position (left/right). final PdfActivityConfiguration.Builder
page(@IntRange(from = 0) Integer pageIndex)
Sets the page to start the document at. final PdfActivityConfiguration.Builder
startZoomScale(Float startZoomScale)
Sets the start scale at which the document will be displayed. final PdfActivityConfiguration.Builder
maxZoomScale(@FloatRange(from = 1.0, to = 20.0) Float scale)
Sets the maximum zoom scale at which the document should be displayed. final PdfActivityConfiguration.Builder
zoomOutBounce(Boolean zoomOutBounce)
Should the zoom out below the minimum zoom have a bounce-back effect on a page. final PdfActivityConfiguration.Builder
textSelectionEnabled(Boolean isTextSelectionEnabled)
Enables or disables text selection (both programmatically and via long-press gesture). final PdfActivityConfiguration.Builder
searchConfiguration(SearchConfiguration searchConfiguration)
Sets configuration used for searching, applied to search views. final PdfActivityConfiguration.Builder
excludedAnnotationTypes(List<AnnotationType> excludedAnnotationTypes)
Sets a list of annotation types that will be excluded from rendering. final PdfActivityConfiguration.Builder
videoPlaybackEnabled(Boolean videoPlaybackEnabled)
Enables or disables video playback. final PdfActivityConfiguration.Builder
setMeasurementToolsEnabled(Boolean measurementToolsEnabled)
Enables or disables measurement tools functionality. final PdfActivityConfiguration.Builder
disableAnnotationLimitedToPageBounds()
Disables the page bounds limit imposed when dragging annotations. final PdfActivityConfiguration.Builder
setEnableNoteAnnotationNoZoomHandling(Boolean noZoomHandlingEnabled)
Enables or disables handling for AnnotationFlags.NOZOOM flag for note annotations. final PdfActivityConfiguration.Builder
setJavaScriptEnabled(Boolean isEnabled)
Enables or disables JavaScript processing. final PdfActivityConfiguration.Builder
setTabBarHidingMode(TabBarHidingMode tabBarHidingMode)
Configures the tab bar hiding mode. final PdfActivityConfiguration.Builder
setVolumeButtonsNavigationEnabled(Boolean isVolumeButtonsNavigationEnabled)
Enables or disables volume buttons navigation. final PdfActivityConfiguration.Builder
textSelectionPopupToolbarEnabled(Boolean enabled)
Sets whether the text selection popup toolbar is enabled or not. final PdfActivityConfiguration.Builder
annotationPopupToolbarEnabled(Boolean enabled)
Sets whether the annotation popup toolbar is enabled or not. final PdfActivityConfiguration.Builder
allowMultipleBookmarksPerPage(Boolean allowed)
Sets whether multiple bookmarks per page can be added or not. final PdfActivityConfiguration.Builder
scrollOnEdgeTapEnabled(Boolean enabled)
Sets whether taps on the edge of a page scroll to the next / previous page. final PdfActivityConfiguration.Builder
animateScrollOnEdgeTaps(Boolean enabled)
Sets whether page changes triggered by tapping the page edge cause an animation. final PdfActivityConfiguration.Builder
scrollOnEdgeTapMargin(@IntRange(from = 1) Integer marginDp)
Margin in dp in which taps on the edge of the page will trigger the page navigation. final PdfActivityConfiguration.Builder
enableMagnifier(Boolean enabled)
Sets whether the magnifier is shown when text selection handles are touched. final PdfActivityConfiguration.Builder
showSignHereOverlay(Boolean showOverlay)
Sets whether the sign here overlay is shown inside of signature form fields. final PdfActivityConfiguration.Builder
setOutlineElementState(OutlineElementState outlineElementState)
Sets whether outline elements are expanded or collapsed. final PdfActivityConfiguration.Builder
showNoteEditorForNewNoteAnnotations(Boolean showNoteEditorForNewNoteAnnotations)
Sets whether the note editor should be started automatically for newly created note annotations. final PdfActivityConfiguration.Builder
enableReaderView(Boolean readerViewEnabled)
Sets whether we enable the reader view in the activity or not. final PdfActivityConfiguration.Builder
setRedactionUiEnabled(Boolean redactionUiEnabled)
Sets whether we show the UI to apply redactions when there are com.pspdfkit.annotations.RedactionAnnotation in the document or not. final PdfActivityConfiguration.Builder
setMultithreadedRenderingEnabled(Boolean isMultithreadedRenderingEnabled)
Sets whether the multithreaded rendering should be enabled. final PdfActivityConfiguration.Builder
stylusOnDetectionEnabled(Boolean enableStylusOnDetection)
Indicates whether we should automatically detect the stylus. final PdfActivityConfiguration
build()
Generates the PdfActivityConfiguration instance. -
-
Constructor Detail
-
PdfActivityConfiguration.Builder
PdfActivityConfiguration.Builder(Context context)
Creates a new com.pspdfkit.ui.PdfActivity configuration builder.- Parameters:
context
- Context object needed for initialization.
-
PdfActivityConfiguration.Builder
PdfActivityConfiguration.Builder(PdfActivityConfiguration configuration)
Create a new builder from existing configuration.- Parameters:
configuration
- PdfActivityConfiguration used to initialized builder.
-
-
Method Detail
-
configuration
final PdfActivityConfiguration.Builder configuration(PdfConfiguration configuration)
Replaces all properties from the PdfConfiguration
- Parameters:
configuration
- Configuration which properties will be copied to this builder.
-
title
final 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, ornull
to use automated title extraction.
-
layout
final PdfActivityConfiguration.Builder layout(@LayoutRes() Integer 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 R.layout.pspdf__pdf_activity.- Parameters:
layoutRes
- Resource identifier of the activity layout.
-
theme
final PdfActivityConfiguration.Builder theme(@StyleRes() Integer themeRes)
Sets a
themeRes
used to override default activity theme.- Parameters:
themeRes
- Theme resource id used by the launched activity.
-
themeDark
final PdfActivityConfiguration.Builder themeDark(@StyleRes() Integer themeDarkRes)
Sets a
themeDarkRes
used to override dark activity theme.- Parameters:
themeDarkRes
- Theme resource id used by the launched activity in dark mode.
-
scrollDirection
final PdfActivityConfiguration.Builder scrollDirection(PageScrollDirection orientation)
Sets the scrolling direction (i.e. the
orientation
) for the document. This defaults to PageScrollDirection.HORIZONTAL.- Parameters:
orientation
- Scrolling direction from PageScrollDirection.
-
scrollMode
final PdfActivityConfiguration.Builder scrollMode(PageScrollMode mode)
Sets the scrolling mode. Currently supported scrolling modes are PageScrollMode.PER_PAGE (also called paginated scroll mode) which will snap in pages, and PageScrollMode.CONTINUOUS which will not snap in to pages, but allow to scroll continuously.
- Parameters:
mode
- Page scroll mode from PageScrollMode.
-
forceSignatureButtonPositionInMainToolbar
final 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.
-
layoutMode
final 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.
-
themeMode
final PdfActivityConfiguration.Builder themeMode(ThemeMode mode)
Sets the app theme mode. Night mode automatically inverts colors.
- Parameters:
mode
- Theme mode set with ThemeMode.
-
firstPageAlwaysSingle
final 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.
-
showGapBetweenPages
final PdfActivityConfiguration.Builder showGapBetweenPages(Boolean showGapBetweenPages)
Sets whether to show gao between pages in double page mode or not.
- Parameters:
showGapBetweenPages
- Iftrue
, there will be a gap between pages in double page mode, iffalse
the pages will be joined.
-
fitMode
final PdfActivityConfiguration.Builder fitMode(PageFitMode mode)
Sets the page fit mode. Valid modes are PageFitMode.FIT_TO_SCREEN which will try to fit pages into the device's screen, or PageFitMode.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.
-
scrollbarsEnabled
final PdfActivityConfiguration.Builder scrollbarsEnabled(Boolean scrollbarsEnabled)
Sets the document scrollbars to be enabled or disabled.
- Parameters:
scrollbarsEnabled
-true
to enable document scrollbars (default), orfalse
to disable them.
-
invertColors
final 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.
-
toGrayscale
final 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.
-
autosaveEnabled
final 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 PdfFragment.onStop.
-
pagePadding
final PdfActivityConfiguration.Builder pagePadding(Integer pagePaddingDp)
Sets the padding between pages. Defaults to 16dp.
- Parameters:
pagePaddingDp
- padding between pages in density independent pixels (dp).
-
restoreLastViewedPage
final 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. Iffalse
, the document will be opened at page index0
. Defaults totrue
.
-
automaticallyGenerateLinks
final 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, orfalse
to disable it.
-
copyPastEnabled
final PdfActivityConfiguration.Builder copyPastEnabled(Boolean enable)
Enable/disable copy and paste of annotations.
-
enableCopyPaste
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "copyPastEnabled(true) ")) final PdfActivityConfiguration.Builder enableCopyPaste()
Enables copy and paste of annotations.
-
disableCopyPaste
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "copyPastEnabled(false) ")) final PdfActivityConfiguration.Builder disableCopyPaste()
Disables copy and paste of annotations.
-
setEnabledCopyPasteFeatures
final PdfActivityConfiguration.Builder setEnabledCopyPasteFeatures(EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the CopyPasteFeatures that are enabled. Defaults to all features being enabled.
-
undoEnabled
final 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. Iffalse
the user will not be able to undo edits and redo will also be disabled.- Parameters:
undoEnabled
-true
to enable undo support, orfalse
to disable it.
-
redoEnabled
final PdfActivityConfiguration.Builder redoEnabled(Boolean redoEnabled)
Enables or disables redo support. If
true
we will allow the user to redo changes that were undone before. Iffalse
the user will not be able to redo edits. If undo is disabled setting this totrue
will not do anything.- Parameters:
redoEnabled
-true
to enable redo support, orfalse
to disable it.
-
setSignaturePickerOrientation
final PdfActivityConfiguration.Builder setSignaturePickerOrientation(SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker. Defaults to SignaturePickerOrientation.AUTOMATIC.
- Parameters:
orientation
- The orientation to use for the signature picker.
-
signatureSavingStrategy
final PdfActivityConfiguration.Builder signatureSavingStrategy(SignatureSavingStrategy signatureSavingStrategy)
Signature saving strategy used within the dialog when adding signatures. Defaults to SignatureSavingStrategy.SAVE_IF_SELECTED. This will only work if a com.pspdfkit.signatures.storage.SignatureStorage has been created and set via com.pspdfkit.ui.PdfFragment.setSignatureStorage, otherwise SignatureSavingStrategy.NEVER_SAVE will be used.
- Parameters:
signatureSavingStrategy
- Signature strategy to apply to saving signatures.
-
signatureColorOptions
final 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 SignatureColorOptions.fromColorRes and SignatureColorOptions.fromColorInt respectively.
-
signatureCreationModes
final PdfActivityConfiguration.Builder signatureCreationModes(@Size(min = 1, max = 3) 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.
-
annotationReplyFeatures
final PdfActivityConfiguration.Builder annotationReplyFeatures(AnnotationReplyFeatures annotationReplyFeatures)
Configures which part of the annotation replies UI is enabled. If AnnotationReplyFeatures.ENABLED, the replies can be added to note annotations and annotation notes. If AnnotationReplyFeatures.READ_ONLY, the replies can be looked at but none can be added or modified. If AnnotationReplyFeatures.DISABLED, the reply UI is disabled entirely. This feature is only UI specific, defining the replies availability in the com.pspdfkit.ui.PdfFragment's UI. The API for retrieving and adding replies still works even if this property is AnnotationReplyFeatures.DISABLED.
- Parameters:
annotationReplyFeatures
- Which features of annotation reply UI to enable.
-
backgroundColor
final PdfActivityConfiguration.Builder backgroundColor(@ColorInt() Integer backgroundColor)
Sets color of PDF background.
Color#WHITE
by default.- Parameters:
backgroundColor
- PDF paper color in integer ARGB format.
-
loadingProgressDrawable
final PdfActivityConfiguration.Builder loadingProgressDrawable(@DrawableRes() Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded.
- Parameters:
loadingProgressDrawable
- Resource ID of the progress drawable.
-
memoryCacheSize
final PdfActivityConfiguration.Builder memoryCacheSize(Integer memoryCacheSize)
Sets size of memory cache for rendered pages and bitmaps. Defaults to 1/4 of available heap size of the app. <br></br>
Note: Disabling this might lead to severe performance problems.
- Parameters:
memoryCacheSize
- Size of memory cache in bytes.
-
setDocumentInfoViewSeparated
final 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), orfalse
otherwise
-
documentInfoViewEnabled
final PdfActivityConfiguration.Builder documentInfoViewEnabled(Boolean enable)
Enable/disable document info view.
-
enableDocumentInfoView
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "documentInfoViewEnabled(true) ")) final PdfActivityConfiguration.Builder enableDocumentInfoView()
Enables the document info view.
-
disableDocumentInfoView
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "documentInfoViewEnabled(false) ")) final PdfActivityConfiguration.Builder disableDocumentInfoView()
Disables the document info view.
-
useImmersiveMode
final 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, orfalse
to deactivate it.
-
pageNumberOverlayEnabled
final PdfActivityConfiguration.Builder pageNumberOverlayEnabled(Boolean enable)
Show/hide the overlay displaying currently selected page.
-
hidePageNumberOverlay
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "pageNumberOverlayEnabled(true) ")) final PdfActivityConfiguration.Builder hidePageNumberOverlay()
Hides the overlay displaying currently selected page.
-
showPageNumberOverlay
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "pageNumberOverlayEnabled(false) ")) final PdfActivityConfiguration.Builder showPageNumberOverlay()
Shows overlay displaying current page number over document.
-
pageLabelsEnabled
final PdfActivityConfiguration.Builder pageLabelsEnabled(Boolean enable)
Show/hide page labels (if any).
-
hidePageLabels
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "pageLabelsEnabled(true) ")) final PdfActivityConfiguration.Builder hidePageLabels()
Hides page labels (if any).
-
showPageLabels
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "pageLabelsEnabled(false) ")) final PdfActivityConfiguration.Builder showPageLabels()
Enables display of the page labels (if any).
-
documentTitleOverlayEnabled
final PdfActivityConfiguration.Builder documentTitleOverlayEnabled(Boolean enable)
Show/hide document title.
-
hideDocumentTitleOverlay
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "documentTitleOverlayEnabled(false) ")) final PdfActivityConfiguration.Builder hideDocumentTitleOverlay()
Hides the overlay displaying the document title.
-
showDocumentTitleOverlay
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "documentTitleOverlayEnabled(true) ")) final PdfActivityConfiguration.Builder showDocumentTitleOverlay()
Shows overlay displaying the document title.
-
navigationButtonsEnabled
final PdfActivityConfiguration.Builder navigationButtonsEnabled(Boolean enable)
Show/hide the navigation buttons.
-
hideNavigationButtons
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "navigationButtonsEnabled(false) ")) final PdfActivityConfiguration.Builder hideNavigationButtons()
Hides the navigation buttons.
-
showNavigationButtons
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "navigationButtonsEnabled(true) ")) final PdfActivityConfiguration.Builder showNavigationButtons()
Shows the navigation buttons.
-
settingsMenuEnabled
final PdfActivityConfiguration.Builder settingsMenuEnabled(Boolean enable)
Show/hide the settings menu icon.
-
hideSettingsMenu
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "settingsMenuEnabled(false) ")) final PdfActivityConfiguration.Builder hideSettingsMenu()
Hides the settings menu icon.
-
showSettingsMenu
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "settingsMenuEnabled(true) ")) final PdfActivityConfiguration.Builder showSettingsMenu()
Shows the settings menu icon.
-
setSettingsMenuItems
final 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.
-
setThumbnailBarMode
final PdfActivityConfiguration.Builder setThumbnailBarMode(ThumbnailBarMode thumbnailBarMode)
Sets the thumbnail bar mode.
- Parameters:
thumbnailBarMode
- Thumbnail bar mode to be set on the activity.
-
thumbnailGridEnabled
final PdfActivityConfiguration.Builder thumbnailGridEnabled(Boolean enable)
Show/hide the actionbar icon to show grid of thumbnail pages.
-
showThumbnailGrid
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "thumbnailGridEnabled(true) ")) final PdfActivityConfiguration.Builder showThumbnailGrid()
Displays an actionbar icon to show grid of thumbnail pages.
-
hideThumbnailGrid
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "thumbnailGridEnabled(false) ")) final PdfActivityConfiguration.Builder hideThumbnailGrid()
Hides the actionbar icon to show grid of thumbnail pages.
-
documentEditorEnabled
final PdfActivityConfiguration.Builder documentEditorEnabled(Boolean enable)
Enable/disable document editing functionality in the page grid.
-
disableDocumentEditor
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "documentEditorEnabled(false) ")) final PdfActivityConfiguration.Builder disableDocumentEditor()
Disables document editing functionality in the page grid.
-
enableDocumentEditor
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "documentEditorEnabled(true) ")) final PdfActivityConfiguration.Builder enableDocumentEditor()
Enables document editing functionality in the page grid.
-
searchEnabled
final PdfActivityConfiguration.Builder searchEnabled(Boolean enable)
Enable/disable document search functionality.
-
enableSearch
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "searchEnabled(true) ")) final PdfActivityConfiguration.Builder enableSearch()
Enables document search functionality.
-
disableSearch
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "searchEnabled(false) ")) final PdfActivityConfiguration.Builder disableSearch()
Disables document search functionality.
-
printingEnabled
final PdfActivityConfiguration.Builder printingEnabled(Boolean enable)
Enable/disable printing option in the menu if applicable for the document and the device.
-
enablePrinting
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "printingEnabled(true) ")) final PdfActivityConfiguration.Builder enablePrinting()
Enables printing option in the menu if applicable for the document and the device.
-
disablePrinting
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "printingEnabled(false) ")) final PdfActivityConfiguration.Builder disablePrinting()
Hides printing option in the sharing menu even if printing can be done on the device.
-
annotationListEnabled
final PdfActivityConfiguration.Builder annotationListEnabled(Boolean enable)
Enable/disable the list of annotations.
-
enableAnnotationList
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "annotationListEnabled(true) ")) final PdfActivityConfiguration.Builder enableAnnotationList()
Enables the list of annotations.
-
disableAnnotationList
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "annotationListEnabled(false) ")) final PdfActivityConfiguration.Builder disableAnnotationList()
Disables the list of annotations.
-
defaultToolbarEnabled
final PdfActivityConfiguration.Builder defaultToolbarEnabled(Boolean enable)
Enable/disable default toolbar.
-
enableDefaultToolbar
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "defaultToolbarEnabled(true) ")) final PdfActivityConfiguration.Builder enableDefaultToolbar()
Enables default toolbar.
-
disableDefaultToolbar
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "defaultToolbarEnabled(false) ")) final PdfActivityConfiguration.Builder disableDefaultToolbar()
Disables default toolbar.
-
annotationListReorderingEnabled
final PdfActivityConfiguration.Builder annotationListReorderingEnabled(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.
-
listedAnnotationTypes
final 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 AnnotationType.LINK.
- Parameters:
listedAnnotationTypes
- Set of types to be displayed in the annotation list.
-
bookmarkListEnabled
final PdfActivityConfiguration.Builder bookmarkListEnabled(Boolean enable)
Enable/disable the display of bookmarks.
-
enableBookmarkList
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "bookmarkListEnabled(true) ")) final PdfActivityConfiguration.Builder enableBookmarkList()
Enables the display of bookmarks.
-
disableBookmarkList
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "bookmarkListEnabled(false) ")) final PdfActivityConfiguration.Builder disableBookmarkList()
Disables the display of bookmarks.
-
bookmarkEditingEnabled
final PdfActivityConfiguration.Builder bookmarkEditingEnabled(Boolean enable)
Enable/disable editing controls on the bookmarks list.
-
enableBookmarkEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "bookmarkEditingEnabled(true) ")) final PdfActivityConfiguration.Builder enableBookmarkEditing()
Enables editing controls on the bookmarks list.
-
disableBookmarkEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "bookmarkEditingEnabled(false) ")) final PdfActivityConfiguration.Builder disableBookmarkEditing()
Disabled editing controls on the bookmarks list.
-
outlineEnabled
final PdfActivityConfiguration.Builder outlineEnabled(Boolean enable)
Enable/disable outline menu in the activity.
-
enableOutline
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "outlineEnabled(true) ")) final PdfActivityConfiguration.Builder enableOutline()
Enables outline menu in the activity.
-
disableOutline
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "outlineEnabled(false) ")) final PdfActivityConfiguration.Builder disableOutline()
Disables outline menu in the activity.
-
embeddedFilesViewEnabled
final PdfActivityConfiguration.Builder embeddedFilesViewEnabled(Boolean enable)
Enables the embedded files menu in the activity.
-
enableEmbeddedFilesView
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "embeddedFilesViewEnabled(true) ")) final PdfActivityConfiguration.Builder enableEmbeddedFilesView()
Enables the embedded files menu in the activity.
-
disableEmbeddedFilesView
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "embeddedFilesViewEnabled(false) ")) final PdfActivityConfiguration.Builder disableEmbeddedFilesView()
Disables the embedded files menu in the activity.
-
setEnabledShareFeatures
final 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 com.pspdfkit.ui.PdfActivity. The sharing API still works even if certain share feature is disabled.
- Parameters:
enabledShareFeatures
- Set of share features to enable.
-
formEditingEnabled
final PdfActivityConfiguration.Builder formEditingEnabled(Boolean enable)
Enable/disable form editing functionality.
-
enableFormEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "formEditingEnabled(true) ")) final PdfActivityConfiguration.Builder enableFormEditing()
Enables form editing functionality.
-
disableFormEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "formEditingEnabled(false) ")) final PdfActivityConfiguration.Builder disableFormEditing()
Disables form editing functionality.
-
annotationEditingEnabled
final PdfActivityConfiguration.Builder annotationEditingEnabled(Boolean enable)
Enable/disable annotation editing functionality.
-
enableAnnotationEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "annotationEditingEnabled(true) ")) final PdfActivityConfiguration.Builder enableAnnotationEditing()
Enables annotation editing functionality.
-
disableAnnotationEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "annotationEditingEnabled(false) ")) final PdfActivityConfiguration.Builder disableAnnotationEditing()
Disables annotation editing functionality.
-
annotationRotationEnabled
final PdfActivityConfiguration.Builder annotationRotationEnabled(Boolean enable)
Enable/disable annotation rotation functionality.
-
enableAnnotationRotation
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "annotationRotationEnabled(true) ")) final PdfActivityConfiguration.Builder enableAnnotationRotation()
Enables annotation rotation functionality.
-
disableAnnotationRotation
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "annotationRotationEnabled(false) ")) final PdfActivityConfiguration.Builder disableAnnotationRotation()
Disables annotation rotation functionality.
-
contentEditingEnabled
final PdfActivityConfiguration.Builder contentEditingEnabled(Boolean enable)
Enable/disable content editing functionality.
-
enableContentEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "contentEditingEnabled(true) ")) final PdfActivityConfiguration.Builder enableContentEditing()
Enables content editing functionality.
-
disableContentEditing
@Deprecated(message = "v2024.8: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "contentEditingEnabled(false) ")) final PdfActivityConfiguration.Builder disableContentEditing()
Disables content editing functionality.
-
editableAnnotationTypes
final 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.
-
enabledAnnotationTools
final 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 (AnnotationTool.toAnnotationType) is editable (see editableAnnotationTypes) and annotation editing is enabled (enableAnnotationEditing]).
- Parameters:
enabledAnnotationTools
- List of supported annotation tools.
-
setSelectedAnnotationResizeEnabled
final 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, orfalse
to disable resizing.
-
selectedAnnotationResizeGuidesEnabled
final PdfActivityConfiguration.Builder selectedAnnotationResizeGuidesEnabled(Boolean enabled)
Enables or disables resize guides. This defaults to
true
.- Parameters:
enabled
-true
to enable resize guides for resizable annotations, orfalse
to disable guides.
-
selectedFreetextAnnotationFontScalingOnResizeEnabled
final PdfActivityConfiguration.Builder selectedFreetextAnnotationFontScalingOnResizeEnabled(Boolean enabled)
Enables or disables font scaling. This defaults to
true
.- Parameters:
enabled
-true
to enable font scaling on resize, orfalse
to disable.
-
setResizeGuideSnapAllowance
final PdfActivityConfiguration.Builder setResizeGuideSnapAllowance(@FloatRange(from = 0.0) Float snapAllowance)
Sets how aggressively the resize guides works.
- Parameters:
snapAllowance
- How many pixels around the guide line will snap to guide when resizing.
-
setResizeGuideLineIntervals
final PdfActivityConfiguration.Builder setResizeGuideLineIntervals(@Size(min = 2, multiple = 2) 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.
-
setAnnotationInspectorEnabled
final 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.
-
setAnnotationNoteHintingEnabled
final 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.
-
setSearchType
final PdfActivityConfiguration.Builder setSearchType(SearchType searchType)
Sets the search type (if search is enabled).
- Parameters:
searchType
- Search type to be applied to the document, SearchType.INLINE or SearchType.MODULAR.
-
setUserInterfaceViewMode
final PdfActivityConfiguration.Builder setUserInterfaceViewMode(UserInterfaceViewMode userInterfaceViewMode)
Sets the user interface view mode.
- Parameters:
userInterfaceViewMode
- user interface view mode to be set on the activity.
-
hideUserInterfaceWhenCreatingAnnotations
final 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 UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_AUTOMATIC and UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_AUTOMATIC_BORDER_PAGES.
- Parameters:
hideUserInterfaceWhenCreatingAnnotations
-true
when user interface should be hidden when showing vertical annotation creation toolbar.
-
page
final PdfActivityConfiguration.Builder page(@IntRange(from = 0) Integer 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).
-
startZoomScale
final PdfActivityConfiguration.Builder startZoomScale(Float startZoomScale)
Sets the start scale at which the document will be displayed. Defaults to com.pspdfkit.ui.PdfFragment.DEFAULT_ZOOM.
- Parameters:
startZoomScale
- Starting zoom scale factor.
-
maxZoomScale
final PdfActivityConfiguration.Builder maxZoomScale(@FloatRange(from = 1.0, to = 20.0) Float scale)
Sets the maximum zoom scale at which the document should be displayed. Make sure this value is higher than defaultZoomScale. Defaults to com.pspdfkit.ui.PdfFragment.MAX_ZOOM.
Allowed interval: 1.0, 20.0
- Parameters:
scale
- Scale for the maximum allowed zoom.
-
zoomOutBounce
final 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.
-
textSelectionEnabled
final 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, orfalse
to disable it.
-
searchConfiguration
final PdfActivityConfiguration.Builder searchConfiguration(SearchConfiguration searchConfiguration)
Sets configuration used for searching, applied to search views.
- Parameters:
searchConfiguration
- Configuration to be applied.
-
excludedAnnotationTypes
final 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.
-
videoPlaybackEnabled
final 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.
-
setMeasurementToolsEnabled
final PdfActivityConfiguration.Builder setMeasurementToolsEnabled(Boolean measurementToolsEnabled)
Enables or disables measurement tools functionality.
- Parameters:
measurementToolsEnabled
-true
to enable measurement tools (if licensed), orfalse
to disable it.
-
disableAnnotationLimitedToPageBounds
final 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.
-
setEnableNoteAnnotationNoZoomHandling
final PdfActivityConfiguration.Builder setEnableNoteAnnotationNoZoomHandling(Boolean noZoomHandlingEnabled)
Enables or disables handling for AnnotationFlags.NOZOOM flag for note annotations. Note annotations are always displayed as if AnnotationFlags.NOZOOM flag was set by default.
- Parameters:
noZoomHandlingEnabled
- Iftrue
, note annotations will respect missing AnnotationFlags.NOZOOM flag and will allow zoom in that case.
-
setJavaScriptEnabled
final 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.
-
setTabBarHidingMode
final PdfActivityConfiguration.Builder setTabBarHidingMode(TabBarHidingMode tabBarHidingMode)
Configures the tab bar hiding mode.
- Parameters:
tabBarHidingMode
- Mode governing com.pspdfkit.ui.tabs.PdfTabBar hiding policy.
-
setVolumeButtonsNavigationEnabled
final 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, orfalse
to disable it.
-
textSelectionPopupToolbarEnabled
final 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 com.pspdfkit.ui.PdfActivity, the old text selection toolbar will be used.
- Parameters:
enabled
-true
to enable it,false
otherwise.
-
annotationPopupToolbarEnabled
final PdfActivityConfiguration.Builder annotationPopupToolbarEnabled(Boolean enabled)
Sets whether the annotation popup toolbar is enabled or not. If disabled, we don't show the popup toolbar when you long press a selected annotation.
- Parameters:
enabled
-true
to enable it,false
to disable it.
-
allowMultipleBookmarksPerPage
final 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, orfalse
so that only one bookmark can be added per page.
-
scrollOnEdgeTapEnabled
final 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.
-
animateScrollOnEdgeTaps
final 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.
-
scrollOnEdgeTapMargin
final PdfActivityConfiguration.Builder scrollOnEdgeTapMargin(@IntRange(from = 1) Integer 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.
-
enableMagnifier
final 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.
-
showSignHereOverlay
final 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.
-
setOutlineElementState
final PdfActivityConfiguration.Builder setOutlineElementState(OutlineElementState outlineElementState)
Sets whether outline elements are expanded or collapsed.
- Parameters:
outlineElementState
- enum state.
-
showNoteEditorForNewNoteAnnotations
final PdfActivityConfiguration.Builder showNoteEditorForNewNoteAnnotations(Boolean showNoteEditorForNewNoteAnnotations)
Sets whether the note editor should be started automatically for newly created note annotations. Defaults to
true
.- Parameters:
showNoteEditorForNewNoteAnnotations
-true
if the note editor should be started automatically,
-
enableReaderView
final 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.
-
setRedactionUiEnabled
final PdfActivityConfiguration.Builder setRedactionUiEnabled(Boolean redactionUiEnabled)
Sets whether we show the UI to apply redactions when there are com.pspdfkit.annotations.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.
-
setMultithreadedRenderingEnabled
final 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.
-
stylusOnDetectionEnabled
final PdfActivityConfiguration.Builder stylusOnDetectionEnabled(Boolean enableStylusOnDetection)
Indicates whether we should automatically detect the stylus. Enabling this will automatically disable all other inputs once we detect stylus use. Enabling this will also allow for swiping between pages with the finger during annotating and automatically turn on the "Use stylus for annotating" switch, if it is off. Disabling this setting allows for drawing with both the stylus and the finger but prevents swiping with the finger during annotating unless the "Use stylus for annotating" setting switch in the document has been manually turned on. Defaults to
true
-
build
final PdfActivityConfiguration build()
Generates the PdfActivityConfiguration instance.
- Returns:
Configured activity configuration instance.
-
-
-
-