Class PdfConfiguration.Builder
-
- All Implemented Interfaces:
public final class PdfConfiguration.Builder
Builder used to construct PdfConfiguration instance.
-
-
Constructor Summary
Constructors Constructor Description PdfConfiguration.Builder()
Creates a new PdfConfiguration builder. PdfConfiguration.Builder(PdfConfiguration configuration)
Create a new builder from existing configuration.
-
Method Summary
Modifier and Type Method Description PdfConfiguration.Builder
scrollDirection(@NonNull() PageScrollDirection orientation)
Sets scrolling direction for the document. PdfConfiguration.Builder
scrollMode(@NonNull() PageScrollMode mode)
Sets the page scrolling mode - if the scrolling position will always snap to page or not. PdfConfiguration.Builder
fitMode(@NonNull() PageFitMode mode)
Sets the page fit mode, or how the screen should fit the document. PdfConfiguration.Builder
layoutMode(@NonNull() PageLayoutMode mode)
Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically). PdfConfiguration.Builder
enableStylusOnDetection(boolean enableStylusOnDetection)
Indicates whether we should automatically detect the stylus. PdfConfiguration.Builder
themeMode(@NonNull() ThemeMode mode)
Sets the app theme mode. PdfConfiguration.Builder
firstPageAlwaysSingle(boolean firstPageAlwaysSingle)
Sets whether the first page should always be displayed as a single or not. PdfConfiguration.Builder
showGapBetweenPages(boolean showGapBetweenPages)
Sets whether to show gao between pages in double page mode or not. PdfConfiguration.Builder
scrollbarsEnabled(boolean scrollbarsEnabled)
Sets the document scrollbars to be enabled or disabled. PdfConfiguration.Builder
backgroundColor(@ColorInt() int backgroundColor)
Sets color of PDF background. PdfConfiguration.Builder
loadingProgressDrawable(@Nullable() @DrawableRes() Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded. PdfConfiguration.Builder
memoryCacheSize(int memoryCacheSize)
Sets the size of memory cache for rendered pages and bitmaps. PdfConfiguration.Builder
invertColors(boolean invertColors)
Sets if the colors will be inverted in the document. PdfConfiguration.Builder
toGrayscale(boolean toGrayscale)
Sets if the colors will be converted to grayscale. PdfConfiguration.Builder
startZoomScale(float startZoomScale)
Sets the start scale at which the document will be displayed. PdfConfiguration.Builder
maxZoomScale(@FloatRange(from = 1.0, to = 20.0) float scale)
Sets the maximum zoom scale at which the document should be displayed. PdfConfiguration.Builder
zoomOutBounce(boolean zoomOutBounce)
Should the zoom out below the minimum zoom have a bounce-back effect on a page. PdfConfiguration.Builder
excludedAnnotationTypes(@NonNull() List<AnnotationType> excludedAnnotationTypes)
Sets a list of annotation types that will be excluded from rendering. PdfConfiguration.Builder
autosaveEnabled(boolean isAutosaveEnabled)
Enables or disables auto-saving of PDF document changes. PdfConfiguration.Builder
textSelectionEnabled(boolean isTextSelectionEnabled)
Enables or disables text selection (both programmatically and via long-press gesture). PdfConfiguration.Builder
enableFormEditing()
Enables form editing functionality. PdfConfiguration.Builder
disableFormEditing()
Disables form editing functionality. PdfConfiguration.Builder
enableAutoSelectNextFormElement()
Enables functionality that automatically selects next form element. PdfConfiguration.Builder
disableAutoSelectNextFormElement()
Disables functionality that automatically selects next form element. PdfConfiguration.Builder
disableAnnotationEditing()
Disables annotation editing functionality. PdfConfiguration.Builder
enableAnnotationEditing()
Enables annotation editing functionality. PdfConfiguration.Builder
disableAnnotationRotation()
Disables annotation rotation functionality. PdfConfiguration.Builder
enableAnnotationRotation()
Enables annotation rotation functionality. PdfConfiguration.Builder
disableContentEditing()
Disables content editing functionality. PdfConfiguration.Builder
enableContentEditing()
Enables content editing functionality. PdfConfiguration.Builder
setMeasurementToolsEnabled(boolean measurementToolsEnabled)
Enables or disables measurement tools functionality. PdfConfiguration.Builder
disableAnnotationLimitedToPageBounds()
Disables the page bounds limit imposed when dragging annotations. PdfConfiguration.Builder
enableRectangleSelectionForMarkupAnnotations()
Enables the rectangle selection for text markup annotations and disables character based text selection for markup annotations and text redaction. PdfConfiguration.Builder
disableRectangleSelectionForMarkupAnnotations()
Disables the rectangle selection for text markup and redaction annotations and enables character based text selection. PdfConfiguration.Builder
editableAnnotationTypes(@Nullable() List<AnnotationType> editableAnnotationTypes)
Sets a list of annotation types that can be selected on page and edited. PdfConfiguration.Builder
enabledAnnotationTools(@Nullable() List<AnnotationTool> enabledAnnotationTools)
Sets a list of annotation tools that are enabled. PdfConfiguration.Builder
pagePadding(int pagePaddingDp)
Sets the padding between pages. PdfConfiguration.Builder
videoPlaybackEnabled(boolean videoPlaybackEnabled)
Enables or disables video playback. PdfConfiguration.Builder
playingMultipleMediaInstancesEnabled(boolean playingMultipleMediaInstancesEnabled)
Sets whether playing multiple media instances is enabled or not. PdfConfiguration.Builder
restoreLastViewedPage(boolean restoreLastViewedPage)
Enables or disables restoration of the last viewed page when reopening a document. PdfConfiguration.Builder
automaticallyGenerateLinks(boolean automaticallyGenerateLinks)
Enables or disables automatic link generation. PdfConfiguration.Builder
enableCopyPaste()
Enables copy and paste of annotations. PdfConfiguration.Builder
disableCopyPaste()
Disables copy and paste of annotations. PdfConfiguration.Builder
undoEnabled(boolean undoEnabled)
Enables or disables undo support. PdfConfiguration.Builder
redoEnabled(boolean redoEnabled)
Enables or disables redo support. PdfConfiguration.Builder
annotationReplyFeatures(@NonNull() AnnotationReplyFeatures annotationReplyFeatures)
Configures which part of the annotation replies UI is enabled. PdfConfiguration.Builder
signatureSavingStrategy(@NonNull() SignatureSavingStrategy signatureSavingStrategy)
Defines if a signature should be saved after creation. PdfConfiguration.Builder
signatureColorOptions(@NonNull() SignatureColorOptions signatureColorOptions)
Defines the 3 signature color options available when using the Electronic Signatures "Draw" or "Type" signing UI. PdfConfiguration.Builder
signatureCreationModes(@NonNull() @Size(min = 1, max = 3) List<SignatureCreationMode> signatureCreationModes)
The ways in which the user can choose to add their signature. PdfConfiguration.Builder
signatureAppearance(@Nullable() SignatureAppearance signatureAppearance)
Defines the appearance of the digital signature that is added after digitally signing a document. PdfConfiguration.Builder
setEnableNoteAnnotationNoZoomHandling(boolean noZoomHandlingEnabled)
Enables or disables handling for NOZOOM flag for note annotations. PdfConfiguration.Builder
textSelectionPopupToolbarEnabled(boolean enabled)
Sets whether the text selection popup toolbar is enabled or not. PdfConfiguration.Builder
annotationPopupToolbarEnabled(boolean enabled)
Sets whether the annotation popup toolbar is enabled or not. PdfConfiguration.Builder
allowMultipleBookmarksPerPage(boolean allowed)
Sets whether multiple bookmarks per page can be added or not. PdfConfiguration.Builder
scrollOnEdgeTapEnabled(boolean enabled)
Sets whether taps on the edge of a page scroll to the next / previous page. PdfConfiguration.Builder
animateScrollOnEdgeTaps(boolean enabled)
Sets whether page changes triggered by tapping the page edge cause an animation. PdfConfiguration.Builder
scrollOnEdgeTapMargin(@IntRange(from = 1) int marginDp)
Margin in dp in which taps on the edge of the page will trigger the page navigation. PdfConfiguration.Builder
enableMagnifier(boolean enabled)
Sets whether the magnifier is shown when text selection handles are touched. PdfConfiguration.Builder
showSignHereOverlay(boolean showOverlay)
Sets whether the sign here overlay is shown inside of signature form fields. PdfConfiguration.Builder
showNoteEditorForNewNoteAnnotations(boolean showNoteEditorForNewNoteAnnotations)
Sets whether the note editor should be started automatically for newly created note annotations. PdfConfiguration
build()
Creates a @{link PdfConfiguration} with the arguments supplied to this builder. PdfConfiguration.Builder
setFixedLowResRenderPixelCount(@Nullable() Integer fixedLowResRenderPixelCount)
Sets the number of pixels in low resolution renderings to a fixed size. PdfConfiguration.Builder
setMultithreadedRenderingEnabled(boolean isMultithreadedRenderingEnabled)
Sets whether the multithreaded rendering should be enabled. PdfConfiguration.Builder
setFormElementDateAndTimePickerEnabled(boolean enabled)
Enables/Disables date and time picker for form elements. PdfConfiguration.Builder
setSelectedAnnotationResizeEnabled(boolean enabled)
Enable or disable resizing of selected annotations. PdfConfiguration.Builder
setSelectedAnnotationResizeGuidesEnabled(boolean enabled)
Enables or disables resize guides. PdfConfiguration.Builder
setSelectedAnnotationFontScalingOnResizeEnabled(boolean enabled)
Enables or disables font scaling for Freetext annotations when resizing with the bottom right resize handle. PdfConfiguration.Builder
setResizeGuideSnapAllowance(@FloatRange(from = 0.0) float snapAllowance)
Sets how aggressively the resize guides works. PdfConfiguration.Builder
setResizeGuideLineIntervals(@NonNull() @Size(min = 2, multiple = 2) List<Float> intervals)
Sets guide line on/off intervals sizes. PdfConfiguration.Builder
setAnnotationInspectorEnabled(boolean isEnabled)
Sets whether the annotation inspector is enabled. PdfConfiguration.Builder
setEnabledCopyPasteFeatures(@NonNull() EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the CopyPasteFeatures that are enabled. PdfConfiguration.Builder
setEnabledShareFeatures(@NonNull() EnumSet<ShareFeatures> enabledShareFeatures)
Configures which share features are enabled in the UI. PdfConfiguration.Builder
setSignaturePickerOrientation(@NonNull() SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker. PdfConfiguration.Builder
setJavaScriptEnabled(boolean isEnabled)
Enables or disables JavaScript processing. PdfConfiguration.Builder
setOutlineElementState(OutlineElementState outlineElementState)
Sets whether outline elements are expanded or collapsed. -
-
Constructor Detail
-
PdfConfiguration.Builder
PdfConfiguration.Builder()
Creates a new PdfConfiguration builder.
-
PdfConfiguration.Builder
PdfConfiguration.Builder(PdfConfiguration configuration)
Create a new builder from existing configuration.- Parameters:
configuration
- PdfConfiguration used to initialized builder.
-
-
Method Detail
-
scrollDirection
@NonNull() PdfConfiguration.Builder scrollDirection(@NonNull() PageScrollDirection orientation)
Sets scrolling direction for the document.
- Parameters:
orientation
- Scrolling direction set with PageScrollDirection.
-
scrollMode
@NonNull() PdfConfiguration.Builder scrollMode(@NonNull() 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.
-
fitMode
@NonNull() PdfConfiguration.Builder fitMode(@NonNull() 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.
-
layoutMode
@NonNull() PdfConfiguration.Builder layoutMode(@NonNull() 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.
-
enableStylusOnDetection
PdfConfiguration.Builder enableStylusOnDetection(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
-
themeMode
@NonNull() PdfConfiguration.Builder themeMode(@NonNull() ThemeMode mode)
Sets the app theme mode. Night mode automatically inverts colors.
- Parameters:
mode
- Theme mode set with ThemeMode.
-
firstPageAlwaysSingle
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.
-
showGapBetweenPages
PdfConfiguration.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.
-
scrollbarsEnabled
@NonNull() PdfConfiguration.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.
-
backgroundColor
@NonNull() PdfConfiguration.Builder backgroundColor(@ColorInt() int backgroundColor)
Sets color of PDF background. White by default.
- Parameters:
backgroundColor
- Paper color in integer format.
-
loadingProgressDrawable
PdfConfiguration.Builder loadingProgressDrawable(@Nullable() @DrawableRes() Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded.
- Parameters:
loadingProgressDrawable
- Resource ID of the progress drawable.
-
memoryCacheSize
@NonNull() 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.
-
invertColors
@NonNull() 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
-
toGrayscale
@NonNull() 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
-
startZoomScale
@NonNull() 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.
-
maxZoomScale
@NonNull() PdfConfiguration.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.
Default value: {@value PdfFragment#MAX_ZOOM}.
Allowed interval: [1.0, 20.0]
- Parameters:
scale
- Maximum zoom scale factor.
-
zoomOutBounce
@NonNull() 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.
-
excludedAnnotationTypes
@NonNull() PdfConfiguration.Builder excludedAnnotationTypes(@NonNull() 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.
-
autosaveEnabled
@NonNull() 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.
-
textSelectionEnabled
@NonNull() 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, orfalse
to disable it.
-
enableFormEditing
@NonNull() PdfConfiguration.Builder enableFormEditing()
Enables form editing functionality.
-
disableFormEditing
@NonNull() PdfConfiguration.Builder disableFormEditing()
Disables form editing functionality.
-
enableAutoSelectNextFormElement
@NonNull() PdfConfiguration.Builder enableAutoSelectNextFormElement()
Enables functionality that automatically selects next form element. Disabled by default.
-
disableAutoSelectNextFormElement
@NonNull() PdfConfiguration.Builder disableAutoSelectNextFormElement()
Disables functionality that automatically selects next form element. Disabled by default.
-
disableAnnotationEditing
@NonNull() PdfConfiguration.Builder disableAnnotationEditing()
Disables annotation editing functionality.
-
enableAnnotationEditing
@NonNull() PdfConfiguration.Builder enableAnnotationEditing()
Enables annotation editing functionality.
-
disableAnnotationRotation
@NonNull() PdfConfiguration.Builder disableAnnotationRotation()
Disables annotation rotation functionality.
-
enableAnnotationRotation
@NonNull() PdfConfiguration.Builder enableAnnotationRotation()
Enables annotation rotation functionality.
-
disableContentEditing
@NonNull() PdfConfiguration.Builder disableContentEditing()
Disables content editing functionality.
-
enableContentEditing
@NonNull() PdfConfiguration.Builder enableContentEditing()
Enables content editing functionality.
-
setMeasurementToolsEnabled
@NonNull() PdfConfiguration.Builder setMeasurementToolsEnabled(boolean measurementToolsEnabled)
Enables or disables measurement tools functionality.
- Parameters:
measurementToolsEnabled
-true
to enable measurement tools (if licensed), orfalse
to disable it.
-
disableAnnotationLimitedToPageBounds
@NonNull() 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.
-
enableRectangleSelectionForMarkupAnnotations
@NonNull() PdfConfiguration.Builder enableRectangleSelectionForMarkupAnnotations()
Enables the rectangle selection for text markup annotations and disables character based text selection for markup annotations and text redaction. By default rectangle selection is disabled and character based text selection is used.
-
disableRectangleSelectionForMarkupAnnotations
@NonNull() PdfConfiguration.Builder disableRectangleSelectionForMarkupAnnotations()
Disables the rectangle selection for text markup and redaction annotations and enables character based text selection. By default rectangle selection is disabled and character based text selection is used.
-
editableAnnotationTypes
@NonNull() PdfConfiguration.Builder editableAnnotationTypes(@Nullable() 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
@NonNull() PdfConfiguration.Builder enabledAnnotationTools(@Nullable() 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) and annotation editing is enabled (see enableAnnotationEditing).
- Parameters:
enabledAnnotationTools
- List of supported annotation tools.
-
pagePadding
@NonNull() PdfConfiguration.Builder pagePadding(int pagePaddingDp)
Sets the padding between pages. Defaults to 16dp.
- Parameters:
pagePaddingDp
- Padding between pages in density independent pixels (dp).
-
videoPlaybackEnabled
@NonNull() 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.
-
playingMultipleMediaInstancesEnabled
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.
-
restoreLastViewedPage
@NonNull() 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. Iffalse
, the document will be opened at page index0
. Defaults totrue
.- Parameters:
restoreLastViewedPage
-true
to enable restoration of the last viewed page, orfalse
to disable it.
-
automaticallyGenerateLinks
@NonNull() 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, orfalse
to disable it.
-
enableCopyPaste
@NonNull() PdfConfiguration.Builder enableCopyPaste()
Enables copy and paste of annotations.
-
disableCopyPaste
@NonNull() PdfConfiguration.Builder disableCopyPaste()
Disables copy and paste of annotations.
-
undoEnabled
@NonNull() 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. 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
@NonNull() PdfConfiguration.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.
-
annotationReplyFeatures
PdfConfiguration.Builder annotationReplyFeatures(@NonNull() 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.
-
signatureSavingStrategy
@NonNull() PdfConfiguration.Builder signatureSavingStrategy(@NonNull() 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.
- Parameters:
signatureSavingStrategy
- Signature strategy to apply to saving signatures.
-
signatureColorOptions
@NonNull() PdfConfiguration.Builder signatureColorOptions(@NonNull() 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 and fromColorInt respectively.
-
signatureCreationModes
@NonNull() PdfConfiguration.Builder signatureCreationModes(@NonNull() @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 values.
-
signatureAppearance
@NonNull() PdfConfiguration.Builder signatureAppearance(@Nullable() 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 .
- Parameters:
signatureAppearance
- The signature appearance to use ornull
to use the default appearance.
-
setEnableNoteAnnotationNoZoomHandling
@NonNull() 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
- Iftrue
, note annotations will respect missing NOZOOM flag and will allow zoom in that case.
-
textSelectionPopupToolbarEnabled
@NonNull() 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 com.pspdfkit.ui.PdfActivity, the old text selection toolbar will be used.
- Parameters:
enabled
-true
to enable it,false
otherwise.
-
annotationPopupToolbarEnabled
@NonNull() PdfConfiguration.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
@NonNull() 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, orfalse
so that only one bookmark can be added per page.
-
scrollOnEdgeTapEnabled
@NonNull() 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.
-
animateScrollOnEdgeTaps
@NonNull() 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.
-
scrollOnEdgeTapMargin
@NonNull() PdfConfiguration.Builder scrollOnEdgeTapMargin(@IntRange(from = 1) 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.
-
enableMagnifier
@NonNull() 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.
-
showSignHereOverlay
@NonNull() 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.
-
showNoteEditorForNewNoteAnnotations
PdfConfiguration.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,
-
build
@NonNull() PdfConfiguration build()
Creates a @{link PdfConfiguration} with the arguments supplied to this builder.
- Returns:
Newly created configuration.
-
setFixedLowResRenderPixelCount
@NonNull() PdfConfiguration.Builder setFixedLowResRenderPixelCount(@Nullable() 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 benull
.
-
setMultithreadedRenderingEnabled
@NonNull() 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.
-
setFormElementDateAndTimePickerEnabled
@NonNull() PdfConfiguration.Builder setFormElementDateAndTimePickerEnabled(boolean enabled)
Enables/Disables date and time picker for form elements. Enabled by default.
-
setSelectedAnnotationResizeEnabled
@NonNull() 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, orfalse
to disable resizing.
-
setSelectedAnnotationResizeGuidesEnabled
PdfConfiguration.Builder setSelectedAnnotationResizeGuidesEnabled(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.
-
setSelectedAnnotationFontScalingOnResizeEnabled
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, orfalse
to disable it.
-
setResizeGuideSnapAllowance
PdfConfiguration.Builder setResizeGuideSnapAllowance(@FloatRange(from = 0.0) 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.
-
setResizeGuideLineIntervals
PdfConfiguration.Builder setResizeGuideLineIntervals(@NonNull() @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. Defaults to
[5f, 20f]
.- Parameters:
intervals
- List of ON and OFF distances.
-
setAnnotationInspectorEnabled
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.
-
setEnabledCopyPasteFeatures
@NonNull() PdfConfiguration.Builder setEnabledCopyPasteFeatures(@NonNull() EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the CopyPasteFeatures that are enabled. Defaults to all features being enabled.
-
setEnabledShareFeatures
PdfConfiguration.Builder setEnabledShareFeatures(@NonNull() 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.
-
setSignaturePickerOrientation
@NonNull() PdfConfiguration.Builder setSignaturePickerOrientation(@NonNull() SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker. Defaults to AUTOMATIC.
- Parameters:
orientation
- The orientation to use for the signature picker.
-
setJavaScriptEnabled
@NonNull() 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.
-
setOutlineElementState
PdfConfiguration.Builder setOutlineElementState(OutlineElementState outlineElementState)
Sets whether outline elements are expanded or collapsed.
-
-
-
-