| java.lang.Object | |
| ↳ | com.pspdfkit.configuration.PdfConfiguration.Builder |
Builder used to construct PdfConfiguration instance.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Builder()
Creates a new
PdfConfiguration builder. | |||||||||||
|
Builder(PdfConfiguration configuration)
Create a new builder from existing configuration.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PdfConfiguration.Builder |
annotationReplyFeatures(AnnotationReplyFeatures annotationReplyFeatures)
Configures which part of the annotation replies UI is enabled.
| ||||||||||
| PdfConfiguration.Builder |
automaticallyGenerateLinks(boolean automaticallyGenerateLinks)
Enables or disables automatic link generation.
| ||||||||||
| PdfConfiguration.Builder |
autosaveEnabled(boolean isAutosaveEnabled)
Enables or disables auto-saving of PDF document changes.
| ||||||||||
| PdfConfiguration.Builder |
backgroundColor(int backgroundColor)
Sets color of PDF background.
| ||||||||||
| PdfConfiguration |
build()
Creates a @{link PdfConfiguration} with the arguments supplied to this builder.
| ||||||||||
| PdfConfiguration.Builder |
disableAnnotationEditing()
Disables annotation editing functionality.
| ||||||||||
| PdfConfiguration.Builder |
disableAnnotationRotation()
Disables annotation rotation functionality.
| ||||||||||
| PdfConfiguration.Builder |
disableAutoSelectNextFormElement()
Disables functionality that automatically selects next form element.
| ||||||||||
| PdfConfiguration.Builder |
disableCopyPaste()
Disables copy and paste of annotations.
| ||||||||||
| PdfConfiguration.Builder |
disableFormEditing()
Disables form editing functionality.
| ||||||||||
| PdfConfiguration.Builder |
editableAnnotationTypes(List<AnnotationType> editableAnnotationTypes)
Sets a list of annotation types that can be selected on page and edited.
| ||||||||||
| PdfConfiguration.Builder |
embeddedFileSharingEnabled(boolean shareEnabled)
This method is deprecated.
Enable
EMBEDDED_FILE_SHARING via #enabledShareFeatures.
| ||||||||||
| PdfConfiguration.Builder |
enableAnnotationEditing()
Enables annotation editing functionality.
| ||||||||||
| PdfConfiguration.Builder |
enableAnnotationRotation()
Enables annotation rotation functionality.
| ||||||||||
| PdfConfiguration.Builder |
enableAutoSelectNextFormElement()
Enables functionality that automatically selects next form element.
| ||||||||||
| PdfConfiguration.Builder |
enableCopyPaste()
Enables copy and paste of annotations.
| ||||||||||
| PdfConfiguration.Builder |
enableFormEditing()
Enables form editing functionality.
| ||||||||||
| PdfConfiguration.Builder |
enabledAnnotationTools(List<AnnotationTool> enabledAnnotationTools)
Sets a list of annotation tools that are enabled.
| ||||||||||
| PdfConfiguration.Builder |
excludedAnnotationTypes(ArrayList<AnnotationType> excludedAnnotationTypes)
Sets a list of annotation types that will be excluded from rendering.
| ||||||||||
| PdfConfiguration.Builder |
firstPageAlwaysSingle(boolean firstPageAlwaysSingle)
Sets whether the first page should always be displayed as a single or not.
| ||||||||||
| PdfConfiguration.Builder |
fitMode(PageFitMode mode)
Sets the page fit mode, or how the screen should fit the document.
| ||||||||||
| PdfConfiguration.Builder |
invertColors(boolean invertColors)
Sets if the colors will be inverted in the document.
| ||||||||||
| PdfConfiguration.Builder |
layoutMode(PageLayoutMode mode)
Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically).
| ||||||||||
| PdfConfiguration.Builder |
loadingProgressDrawable(Integer loadingProgressDrawable)
Sets a drawable for loading progress throbber while document is loaded.
| ||||||||||
| PdfConfiguration.Builder |
maxZoomScale(float scale)
Sets the maximum zoom scale at which the document should be displayed.
| ||||||||||
| PdfConfiguration.Builder |
memoryCacheSize(int memoryCacheSize)
Sets the size of memory cache for rendered pages and bitmaps.
| ||||||||||
| PdfConfiguration.Builder |
pagePadding(int pagePaddingDp)
Sets the padding between pages.
| ||||||||||
| PdfConfiguration.Builder |
playingMultipleMediaInstancesEnabled(boolean playingMultipleMediaInstancesEnabled)
Sets whether playing multiple media instances is enabled or not.
| ||||||||||
| PdfConfiguration.Builder |
redoEnabled(boolean redoEnabled)
Enables or disables redo support.
| ||||||||||
| PdfConfiguration.Builder |
restoreLastViewedPage(boolean restoreLastViewedPage)
Enables or disables restoration of the last viewed page when reopening a document.
| ||||||||||
| PdfConfiguration.Builder |
scrollDirection(PageScrollDirection orientation)
Sets scrolling direction for the document.
| ||||||||||
| PdfConfiguration.Builder |
scrollMode(PageScrollMode mode)
Sets the page scrolling mode - if the scrolling position will always snap to page or not.
| ||||||||||
| PdfConfiguration.Builder |
scrollbarsEnabled(boolean scrollbarsEnabled)
Sets the document scrollbars to be enabled or disabled.
| ||||||||||
| PdfConfiguration.Builder |
setAnnotationInspectorEnabled(boolean isEnabled)
Sets whether the annotation inspector is enabled.
| ||||||||||
| PdfConfiguration.Builder |
setCustomerSignatureFeatureEnabled(boolean isEnabled)
This method is deprecated.
Use
signatureSavingStrategy(SignatureSavingStrategy) to control how signature saving is performed.
| ||||||||||
| PdfConfiguration.Builder |
setEnableNoteAnnotationNoZoomHandling(boolean noZoomHandlingEnabled)
Enables or disables handling for
NOZOOM flag for note annotations. | ||||||||||
| PdfConfiguration.Builder |
setEnabledCopyPasteFeatures(EnumSet<CopyPasteFeatures> enabledFeatures)
Sets the
CopyPasteFeatures that are enabled. | ||||||||||
| PdfConfiguration.Builder |
setEnabledShareFeatures(EnumSet<ShareFeatures> enabledShareFeatures)
Configures which share features are enabled in the UI.
| ||||||||||
| PdfConfiguration.Builder |
setFixedLowResRenderPixelCount(Integer fixedLowResRenderPixelCount)
Sets the number of pixels in low resolution renderings to a fixed size.
| ||||||||||
| PdfConfiguration.Builder |
setJavaScriptEnabled(boolean isEnabled)
Enables or disables JavaScript processing.
| ||||||||||
| PdfConfiguration.Builder |
setMultithreadedRenderingEnabled(boolean isMultithreadedRenderingEnabled)
Sets whether the multithreaded rendering should be enabled.
| ||||||||||
| PdfConfiguration.Builder |
setResizeGuideLineIntervals(List<Float> intervals)
Sets guide line on/off intervals sizes.
| ||||||||||
| PdfConfiguration.Builder |
setResizeGuideSnapAllowance(float snapAllowance)
Sets how aggressively the resize guides works.
| ||||||||||
| PdfConfiguration.Builder |
setSelectedAnnotationResizeEnabled(boolean enabled)
Enable or disable resizing of selected annotations.
| ||||||||||
| PdfConfiguration.Builder |
setSelectedAnnotationResizeGuidesEnabled(boolean enabled)
Enables or disables resize guides.
| ||||||||||
| PdfConfiguration.Builder |
setSignaturePickerOrientation(SignaturePickerOrientation orientation)
Sets the orientation to use for the signature picker.
| ||||||||||
| PdfConfiguration.Builder |
setSignatureSavingEnabled(boolean isEnabled)
This method is deprecated.
Use
signatureSavingStrategy(SignatureSavingStrategy) to control how signature saving is performed.
| ||||||||||
| PdfConfiguration.Builder |
sharingNoteEditorContentEnabled(boolean enabled)
This method is deprecated.
Enable
NOTE_EDITOR_CONTENT_SHARING via #enabledShareFeatures.
| ||||||||||
| PdfConfiguration.Builder |
showGapBetweenPages(boolean showGapBetweenPages)
Sets whether to show gao between pages in double page mode or not.
| ||||||||||
| PdfConfiguration.Builder |
signatureAppearance(SignatureAppearance signatureAppearance)
Defines the appearance of the digital signature that is added after digitally signing a document.
| ||||||||||
| PdfConfiguration.Builder |
signatureCertificateSelectionMode(SignatureCertificateSelectionMode signatureCertificateSelectionMode)
Defines if the user should be able to select certificates for digitally signing a
document, when creating a new signature.
| ||||||||||
| PdfConfiguration.Builder |
signatureSavingStrategy(SignatureSavingStrategy signatureSavingStrategy)
Defines if a signature should be saved after creation.
| ||||||||||
| PdfConfiguration.Builder |
startZoomScale(float startZoomScale)
Sets the start scale at which the document will be displayed.
| ||||||||||
| PdfConfiguration.Builder |
textSelectionEnabled(boolean isTextSelectionEnabled)
Enables or disables text selection (both programmatically and via long-press gesture).
| ||||||||||
| PdfConfiguration.Builder |
textSelectionPopupToolbarEnabled(boolean enabled)
Sets whether the text selection popup toolbar is enabled or not.
| ||||||||||
| PdfConfiguration.Builder |
textSharingEnabled(boolean shareEnabled)
This method is deprecated.
Enable
TEXT_SELECTION_SHARING via #enabledShareFeatures.
| ||||||||||
| PdfConfiguration.Builder |
themeMode(ThemeMode mode)
Sets the app theme mode.
| ||||||||||
| PdfConfiguration.Builder |
toGrayscale(boolean toGrayscale)
Sets if the colors will be converted to grayscale.
| ||||||||||
| PdfConfiguration.Builder |
undoEnabled(boolean undoEnabled)
Enables or disables undo support.
| ||||||||||
| PdfConfiguration.Builder |
videoPlaybackEnabled(boolean videoPlaybackEnabled)
Enables or disables video playback.
| ||||||||||
| PdfConfiguration.Builder |
zoomOutBounce(boolean zoomOutBounce)
Should the zoom out below the minimum zoom have a bounce-back effect on a page.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a new builder from existing configuration.
| configuration | PdfConfiguration used to initialized builder.
|
|---|
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.
| annotationReplyFeatures | Which features of annotation reply UI to enable. |
|---|
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.
| automaticallyGenerateLinks | true to enable automatic link generation, or false to disable it.
|
|---|
Enables or disables auto-saving of PDF document changes. This is enabled by default.
| isAutosaveEnabled | true to enable autosave in onStop() of the document fragment, false otherwise.
|
|---|
Sets color of PDF background. White by default.
| backgroundColor | Paper color in integer format. |
|---|
Creates a @{link PdfConfiguration} with the arguments supplied to this builder.
Disables annotation editing functionality.
Disables annotation rotation functionality.
Disables functionality that automatically selects next form element. Disabled by default.
Sets a list of annotation types that can be selected on page and edited.
| editableAnnotationTypes | List of annotation types that are selectable. Passing null or an empty list means that ALL supported
annotation types are editable.
|
|---|
This method is deprecated.
Enable EMBEDDED_FILE_SHARING via #enabledShareFeatures.
Enables or disables embedded files sharing. This is enabled by default.
| shareEnabled | true to enable embedded files sharing in the document, false otherwise. |
|---|
Enables annotation editing functionality.
Enables annotation rotation functionality.
Enables functionality that automatically selects next form element. Disabled by default.
Sets a list of annotation tools that are enabled.
Note: AnnotationTool will be enabled only when its underlying annotation type
(toAnnotationType()) is editable (see editableAnnotationTypes(List))
and annotation editing is enabled (see enableAnnotationEditing()).
| enabledAnnotationTools | List of supported annotation tools. Passing null or an empty list means that ALL supported annotation
tools are enabled.
|
|---|
Sets a list of annotation types that will be excluded from rendering.
| excludedAnnotationTypes | List of annotation types that will be excluded from rendering. Passing an empty list means that ALL supported annotation types are rendered. |
|---|
Sets whether the first page should always be displayed as a single or not. This is notable only if double page mode is active.
| firstPageAlwaysSingle | true to always display the first page as a single one, false otherwise.
|
|---|
Sets the page fit mode, or how the screen should fit the document. Default is fit-to-page.
| mode | Fit mode set with PageFitMode.
|
|---|
Sets if the colors will be inverted in the document. This is disabled by default.
| invertColors | true if colors should be inverted, false otherwise
|
|---|
Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically).
| mode | Layout mode set with PageLayoutMode.
|
|---|
Sets a drawable for loading progress throbber while document is loaded.
| loadingProgressDrawable | Resource ID of the progress drawable. If set to null, loading throbber will not be displayed. |
|---|
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]
| scale | Maximum zoom scale factor. |
|---|
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.
| memoryCacheSize | Size of memory cache in bytes. |
|---|
Sets the padding between pages. Defaults to 16dp.
| pagePaddingDp | Padding between pages in density independent pixels (dp). |
|---|
Sets whether playing multiple media instances is enabled or not. This is disabled by default.
| playingMultipleMediaInstancesEnabled | true to enabled playing multiple media instances, false to only play one at a
time.
|
|---|
Enables or disables redo support. If true we will allow the user to redo changes
that were undone before.
If false the user will not be able to redo edits.
If undo is disabled setting this to true will not do anything.
| redoEnabled | true to enable redo support, or false to disable it.
|
|---|
Enables or disables restoration of the last viewed page when reopening a document. If true, the last viewed page will be restored when
opening the document a second time. If false, the document will be opened at page index 0. Defaults to true.
| restoreLastViewedPage | true to enable restoration of the last viewed page, or false to disable it.
|
|---|
Sets scrolling direction for the document.
| orientation | Scrolling direction set with PageScrollDirection.
|
|---|
Sets the page scrolling mode - if the scrolling position will always snap to page or not.
| mode | Scrolling mode set with PageScrollMode.
|
|---|
Sets the document scrollbars to be enabled or disabled.
| scrollbarsEnabled | true to enable document scrollbars (default), or false to disable them.
|
|---|
Sets whether the annotation inspector is enabled. This defaults to true.
| isEnabled | true to enable annotation inspector when creating and editing the annotations.
|
|---|
This method is deprecated.
Use signatureSavingStrategy(SignatureSavingStrategy) to control how signature saving is performed.
Sets whether Customer Signature feature is enabled when adding a signature to the page. Defaults to true.
| isEnabled | true to enable customer signature feature, false to disable |
|---|
Sets the CopyPasteFeatures that are enabled.
Defaults to all features being enabled.
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.
| enabledShareFeatures | Set of share features to enable. |
|---|
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.
| fixedLowResRenderPixelCount | Fixed low resolution pixel count, may be null.
|
|---|
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.
| isEnabled | true to enable JavaScript processing for loaded documents.
|
|---|
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.
| isMultithreadedRenderingEnabled | true to enable multithreaded rendering, false to disable.
|
|---|
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].
| intervals | List of ON and OFF distances. |
|---|
Sets how aggressively the resize guides works. Defaults to 30.0f.
| snapAllowance | How many pixels around the guide line will snap to guide when resizing. |
|---|
Enable or disable resizing of selected annotations. This defaults to true.
| enabled | true to enable resizing of selected annotations, or false to disable resizing.
|
|---|
Enables or disables resize guides. This defaults to true.
| enabled | true to enable resize guides for resizable annotations, or false to disable guides.
|
|---|
Sets the orientation to use for the signature picker. Defaults to AUTOMATIC.
| orientation | The orientation to use for the signature picker. |
|---|
This method is deprecated.
Use signatureSavingStrategy(SignatureSavingStrategy) to control how signature saving is performed.
Sets whether the PSPDFKit will differentiate between My Signature / Customer Signature. Defaults to true.
| isEnabled | true if My Signature option would be present, false if it equals Customer Signature |
|---|
This method is deprecated.
Enable NOTE_EDITOR_CONTENT_SHARING via #enabledShareFeatures.
Sets whether the sharing of note editor content (annotation main content and replies) is enabled or not in the note editor UI.
| enabled | true to enable, false to disable |
|---|
Sets whether to show gao between pages in double page mode or not.
| showGapBetweenPages | If true, there will be a gap between pages in double page mode, if false the pages will be
joined.
|
|---|
Defines the appearance of the digital signature that is added after digitally signing a document.
Things to configure include the graphic to use for the signature or whether the time of signing should be shown.
For the full list of properties check SignatureAppearance.
| signatureAppearance | The signature appearance to use or null to use the default appearance.
|
|---|
Defines if the user should be able to select certificates for digitally signing a
document, when creating a new signature. Defaults to IF_AVAILABLE.
| signatureCertificateSelectionMode | Signature certificate selection mode to be used. |
|---|
Defines if a signature should be saved after creation.
Defaults to SAVE_IF_SELECTED.
| signatureSavingStrategy | Signature strategy to apply to saving signatures. |
|---|
Sets the start scale at which the document will be displayed.
Default value: {@value PdfFragment#DEFAULT_ZOOM}
| startZoomScale | Starting zoom scale factor. |
|---|
Enables or disables text selection (both programmatically and via long-press gesture). This is enabled by default.
| isTextSelectionEnabled | true to enable text selection, or false to disable it.
|
|---|
Sets whether the text selection popup toolbar is enabled or not. If disabled, and this
configuration is used within your PdfActivity, the old text
selection toolbar will be used.
| enabled | true to enable it, false otherwise.
|
|---|
This method is deprecated.
Enable TEXT_SELECTION_SHARING via #enabledShareFeatures.
Enables/disables text sharing (text from text selection or annotations). This is enabled by default.
| shareEnabled | true to enable text sharing in the document, false otherwise. |
|---|
Sets the app theme mode. Night mode automatically inverts colors.
| mode | Theme mode set with ThemeMode.
|
|---|
Sets if the colors will be converted to grayscale. This is disabled by default.
| toGrayscale | true if page should be rendered in grayscale, false otherwise
|
|---|
Enables or disables undo support. If true we will keep track of edits to the document
and allow the user to undo actions.
If false the user will not be able to undo edits and redo will also be disabled.
| undoEnabled | true to enable undo support, or false to disable it.
|
|---|
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.
| videoPlaybackEnabled | true if video playback is enabled, false otherwise.
|
|---|
Should the zoom out below the minimum zoom have a bounce-back effect on a page.
| zoomOutBounce | true if document should have a zoom-out bounce effect, false otherwise.
|
|---|