Class PdfConfiguration
-
- All Implemented Interfaces:
-
android.os.Parcelable
public abstract class PdfConfiguration implements Parcelable
Configuration for the core of PSPDFKit rendering engine. To create the configuration use the Builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
PdfConfiguration.Builder
Builder used to construct PdfConfiguration instance.
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
DEFAULT_LOADING_PROGRESS_DRAWABLE
-
Method Summary
Modifier and Type Method Description abstract PageScrollDirection
getScrollDirection()
Scroll direction of the document (horizontal is default). abstract PageScrollMode
getScrollMode()
Scroll mode of the document (per-page is default). abstract PageFitMode
getFitMode()
Fit mode of the document (fit-to-screen is default). abstract PageLayoutMode
getLayoutMode()
Layout mode of the document (AUTO is default). abstract ThemeMode
getThemeMode()
Theme mode of the whole app (DEFAULT is default). abstract boolean
isFirstPageAlwaysSingle()
Whether the first page should always be displayed as a single or not, false
by default.abstract boolean
showGapBetweenPages()
Whether to show gap between pages in double page mode or not. abstract boolean
isScrollbarsEnabled()
If the default document scrollbars should be enabled (defaults to true
).abstract int
getBackgroundColor()
Document paper color (white is default). abstract Integer
getLoadingProgressDrawable()
Returns drawable for the throbber displayed while loading the document. abstract int
getMemoryCacheSize()
Size of the memory cache (defaults to 1/4 of the available heap size). abstract boolean
isInvertColors()
If the page colors should be inverted (defaults to false
).abstract boolean
isToGrayscale()
Should the page colors be converted to grayscale (defaults to false
).abstract float
getStartZoomScale()
The scale at which the document should start. abstract float
getMaxZoomScale()
Maximum zoom scale in the document. abstract boolean
shouldZoomOutBounce()
Should the zoom out below the minimum zoom have a bounce-back effect on a page. abstract boolean
isTextSelectionEnabled()
If text selection (programmatically and via long-press) is enabled (defaults to true
).abstract boolean
isFormEditingEnabled()
Indicates whether the form editing is enabled or not. abstract boolean
isAutoSelectNextFormElementEnabled()
Indicates whether the auto select next form element functionality is enabled or not (defaults to false
).abstract boolean
isFormElementDateAndTimePickerEnabled()
Indicates whether the date and time pickers should be enabled for according form elements (defaults to true
)abstract boolean
isAnnotationEditingEnabled()
Indicates whether the annotation editing is enabled or not. abstract boolean
isAnnotationRotationEnabled()
Indicates whether the annotation rotation is enabled or not. abstract boolean
isContentEditingEnabled()
Indicates whether the content editing is enabled or not. abstract boolean
isMeasurementsEnabled()
Indicates whether the measurement tools are enabled or not. abstract boolean
isAnnotationLimitedToPageBounds()
Indicates whether the annotations are limited to the page bounds. abstract boolean
useRectangleSelectionForMarkupAnnotations()
Indicates whether the annotations are limited to the page bounds. abstract List<AnnotationType>
getEditableAnnotationTypes()
Returns a list of annotation types that should be editable. abstract List<AnnotationTool>
getEnabledAnnotationTools()
Returns a list of annotation tools that should be enabled. abstract boolean
getSelectedAnnotationResizeEnabled()
Indicates whether the selected annotation resizing is enabled or not. abstract boolean
getSelectedAnnotationResizeGuidesEnabled()
Indicates whether the annotation selection resize guide lines are enabled or not. abstract boolean
getSelectedAnnotationFontScalingOnResizeEnabled()
Indicates whether the font scaling when resizing Freetext annotations with the bottom right handle is enabled. abstract float
getResizeGuideSnapAllowance()
Defines aggressiveness of snapping to guide lines. abstract List<Float>
getGuideLineIntervals()
Defines guide line on/off intervals sizes. abstract boolean
isAnnotationInspectorEnabled()
Indicates whether the annotation creation and editing inspectors are enabled. abstract ArrayList<AnnotationType>
getExcludedAnnotationTypes()
Returns a list of annotation types that will be excluded from rendering. abstract boolean
isAutosaveEnabled()
Whether document autosave is enabled. abstract int
getPagePadding()
The padding between pages (defaults to 16dp). abstract boolean
isVideoPlaybackEnabled()
Whether video playback is enabled in document. abstract boolean
isPlayingMultipleMediaInstancesEnabled()
Whether playing multiple media instances is enabled or not. abstract boolean
isLastViewedPageRestorationEnabled()
Whether restoration of the last viewed page when reopening a document is enabled or not. abstract boolean
isAutomaticLinkGenerationEnabled()
Whether we automatically generating link annotations for links in the document text is enabled or not. abstract boolean
isCopyPasteEnabled()
Whether copy and paste operations are enabled for annotations. abstract EnumSet<CopyPasteFeatures>
getEnabledCopyPasteFeatures()
The enabled CopyPasteFeatures. abstract boolean
isUndoEnabled()
Whether undoing edits is enabled. abstract boolean
isRedoEnabled()
Whether redoing undone edits is enabled. abstract AnnotationReplyFeatures
getAnnotationReplyFeatures()
Which parts of the annotation replies UI are enabled. abstract Integer
getFixedLowResRenderPixelCount()
Returns fixed low resolution render pixel count or null
.abstract boolean
isMultithreadedRenderingEnabled()
Controls whether multithreaded rendering is enabled, defaults to true
.abstract SignaturePickerOrientation
getSignaturePickerOrientation()
The orientation to use for the signature picker, defaults to AUTOMATIC. abstract SignatureSavingStrategy
getSignatureSavingStrategy()
The saving strategy used when adding signatures. abstract SignatureColorOptions
getSignatureColorOptions()
Defines the signature color options available when using the "Draw" or "Type" signing UI. abstract List<SignatureCreationMode>
getSignatureCreationModes()
The ways in which the user can choose to add their signature. abstract SignatureAppearance
getSignatureAppearance()
Defines the appearance of the digital signature that is added after digitally signing a document. abstract boolean
isNoteAnnotationNoZoomHandlingEnabled()
Whether handling for NOZOOM flag for note annotations is enabled. abstract boolean
isJavaScriptEnabled()
Controls whether JavaScript processing is enabled. abstract boolean
isTextSelectionPopupToolbarEnabled()
Whether the text selection popup toolbar is enabled or not. abstract boolean
isAnnotationPopupToolbarEnabled()
Whether the annotation popup toolbar is enabled or not. abstract EnumSet<ShareFeatures>
getEnabledShareFeatures()
Indicates which supported share features are enabled in the UI. abstract boolean
allowMultipleBookmarksPerPage()
Indicates whether multiple bookmarks per page can be added or not, defaults to false
.abstract boolean
scrollOnEdgeTapEnabled()
Indicates whether tapping on the page edge causes the page to scroll. abstract boolean
animateScrollOnEdgeTaps()
Indicates whether page changes triggered by tapping the page edge cause an animation. abstract int
scrollOnEdgeTapMargin()
The margin in DP in which taps on the page edge trigger page navigation. abstract boolean
isMagnifierEnabled()
Indicates whether the magnifier is shown when: - The text selection handles are touched. abstract boolean
showSignHereOverlay()
Indicates whether the sign here overlay is shown on signature form fields. abstract boolean
showNoteEditorForNewNoteAnnotations()
Indicates whether the NoteEditor should be shown automatically when creating new note. abstract boolean
enableStylusOnDetection()
Indicates whether we should automatically detect the stylus. abstract OutlineElementState
getOutlineElementState()
Indicates whether the outline elements expanded or collapsed. -
-
Method Detail
-
getScrollDirection
abstract PageScrollDirection getScrollDirection()
Scroll direction of the document (horizontal is default).
- Returns:
Page scroll direction, HORIZONTAL or VERTICAL.
-
getScrollMode
abstract PageScrollMode getScrollMode()
Scroll mode of the document (per-page is default).
- Returns:
Page scroll mode, PER_PAGE or CONTINUOUS.
-
getFitMode
abstract PageFitMode getFitMode()
Fit mode of the document (fit-to-screen is default).
- Returns:
Page fit mode, FIT_TO_SCREEN or FIT_TO_WIDTH.
-
getLayoutMode
abstract PageLayoutMode getLayoutMode()
Layout mode of the document (AUTO is default).
-
getThemeMode
abstract ThemeMode getThemeMode()
Theme mode of the whole app (DEFAULT is default).
-
isFirstPageAlwaysSingle
abstract boolean isFirstPageAlwaysSingle()
Whether the first page should always be displayed as a single or not,
false
by default.- Returns:
true
to always display the first page as a single (standalone) even in double page mode,false
otherwise.
-
showGapBetweenPages
abstract boolean showGapBetweenPages()
Whether to show gap between pages in double page mode or not. Defaults to
false
.- Returns:
true
to show the gap between pages,false
to join them together.
-
isScrollbarsEnabled
abstract boolean isScrollbarsEnabled()
If the default document scrollbars should be enabled (defaults to
true
).- Returns:
true
if the scrollbars are enabled, otherwisefalse
.
-
getBackgroundColor
@ColorInt() abstract int getBackgroundColor()
Document paper color (white is default).
- Returns:
Default paper color for the document.
-
getLoadingProgressDrawable
@DrawableRes()@Nullable() abstract Integer getLoadingProgressDrawable()
Returns drawable for the throbber displayed while loading the document.
- Returns:
Drawable resource for the throbber displayed when loading a document.
-
getMemoryCacheSize
abstract int getMemoryCacheSize()
Size of the memory cache (defaults to 1/4 of the available heap size).
- Returns:
Memory cache size.
-
isInvertColors
abstract boolean isInvertColors()
If the page colors should be inverted (defaults to
false
).- Returns:
true
is page color will be inverted,false
otherwise.
-
isToGrayscale
abstract boolean isToGrayscale()
Should the page colors be converted to grayscale (defaults to
false
).- Returns:
true
is page color will be converted to grayscale,false
otherwise.
-
getStartZoomScale
abstract float getStartZoomScale()
The scale at which the document should start.
- Returns:
Initial zoom scale of the document.
-
getMaxZoomScale
abstract float getMaxZoomScale()
Maximum zoom scale in the document.
- Returns:
Maximum zoom scale at which the document can be zoomed.
-
shouldZoomOutBounce
abstract boolean shouldZoomOutBounce()
Should the zoom out below the minimum zoom have a bounce-back effect on a page.
- Returns:
true
if the document should bounce when zooming out below the minimum zoom,false
otherwise.
-
isTextSelectionEnabled
abstract boolean isTextSelectionEnabled()
If text selection (programmatically and via long-press) is enabled (defaults to
true
).- Returns:
true
if text selection on the document is enabled,false
otherwise.
-
isFormEditingEnabled
abstract boolean isFormEditingEnabled()
Indicates whether the form editing is enabled or not.
- Returns:
true
if form editing functionality should be enabled.
-
isAutoSelectNextFormElementEnabled
abstract boolean isAutoSelectNextFormElementEnabled()
Indicates whether the auto select next form element functionality is enabled or not (defaults to
false
).- Returns:
true
if auto select next form element functionality should be enabled.
-
isFormElementDateAndTimePickerEnabled
abstract boolean isFormElementDateAndTimePickerEnabled()
Indicates whether the date and time pickers should be enabled for according form elements (defaults to
true
)- Returns:
true
if date and time pickers should be enabled for form elements
-
isAnnotationEditingEnabled
abstract boolean isAnnotationEditingEnabled()
Indicates whether the annotation editing is enabled or not.
- Returns:
true
if annotation editing functionality should be enabled.
-
isAnnotationRotationEnabled
abstract boolean isAnnotationRotationEnabled()
Indicates whether the annotation rotation is enabled or not.
- Returns:
true
if annotation rotation functionality should be enabled.
-
isContentEditingEnabled
abstract boolean isContentEditingEnabled()
Indicates whether the content editing is enabled or not.
- Returns:
true
if content editing functionality should be enabled.
-
isMeasurementsEnabled
abstract boolean isMeasurementsEnabled()
Indicates whether the measurement tools are enabled or not.
- Returns:
true
if measurement tools should be enabled.
-
isAnnotationLimitedToPageBounds
abstract boolean isAnnotationLimitedToPageBounds()
Indicates whether the annotations are limited to the page bounds.
- Returns:
true
if annotations cannot be moved outside the page.
-
useRectangleSelectionForMarkupAnnotations
abstract boolean useRectangleSelectionForMarkupAnnotations()
Indicates whether the annotations are limited to the page bounds.
- Returns:
true
if annotations cannot be moved outside the page.
-
getEditableAnnotationTypes
@NonNull() abstract List<AnnotationType> getEditableAnnotationTypes()
Returns a list of annotation types that should be editable.
- Returns:
List of annotation types that should be editable. Note that empty list here means "All annotations are editable."
-
getEnabledAnnotationTools
abstract List<AnnotationTool> getEnabledAnnotationTools()
Returns a list of annotation tools that should be enabled.
- Returns:
List of enabled annotation tools. Note that empty list here means that all annotation tools are enabled.
-
getSelectedAnnotationResizeEnabled
abstract boolean getSelectedAnnotationResizeEnabled()
Indicates whether the selected annotation resizing is enabled or not.
- Returns:
true
if resizing of selected annotations is enabled, otherwisefalse
.
-
getSelectedAnnotationResizeGuidesEnabled
abstract boolean getSelectedAnnotationResizeGuidesEnabled()
Indicates whether the annotation selection resize guide lines are enabled or not. Defaults to true.
- Returns:
true
if resize guide lines are enabled, otherwisefalse
-
getSelectedAnnotationFontScalingOnResizeEnabled
abstract boolean getSelectedAnnotationFontScalingOnResizeEnabled()
Indicates whether the font scaling when resizing Freetext annotations with the bottom right handle is enabled. Defaults to true.
- Returns:
true
if resize guide lines are enabled, otherwisefalse
-
getResizeGuideSnapAllowance
@FloatRange(from = 0.0) abstract float getResizeGuideSnapAllowance()
Defines aggressiveness of snapping to guide lines.
- Returns:
How many pixels around guide will snap to guide when resizing. Defaults to 30f.
-
getGuideLineIntervals
@Size(min = 2, multiple = 2) abstract List<Float> getGuideLineIntervals()
Defines 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.
- Returns:
List of ON and OFF distances.
-
isAnnotationInspectorEnabled
abstract boolean isAnnotationInspectorEnabled()
Indicates whether the annotation creation and editing inspectors are enabled.
- Returns:
true
when annotation property inspector is enabled.
-
getExcludedAnnotationTypes
@NonNull() abstract ArrayList<AnnotationType> getExcludedAnnotationTypes()
Returns a list of annotation types that will be excluded from rendering.
- Returns:
List of annotation types that will be excluded from rendering. Empty list means "All annotations are rendered."
-
isAutosaveEnabled
abstract boolean isAutosaveEnabled()
Whether document autosave is enabled.
- Returns:
true
if autosave is enabled,false
otherwise.
-
getPagePadding
abstract int getPagePadding()
The padding between pages (defaults to 16dp).
- Returns:
Padding between pages in dp.
-
isVideoPlaybackEnabled
abstract boolean isVideoPlaybackEnabled()
Whether video playback is enabled in document.
- Returns:
true
if video playback is enabledfalse
otherwise (defaults tofalse
).
-
isPlayingMultipleMediaInstancesEnabled
abstract boolean isPlayingMultipleMediaInstancesEnabled()
Whether playing multiple media instances is enabled or not.
- Returns:
true
to enable multiple media instances,false
to always use a single one.
-
isLastViewedPageRestorationEnabled
abstract boolean isLastViewedPageRestorationEnabled()
Whether restoration of the last viewed page when reopening a document is enabled or not. 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
.
-
isAutomaticLinkGenerationEnabled
abstract boolean isAutomaticLinkGenerationEnabled()
Whether we automatically generating link annotations for links in the document text is enabled or not. If
true
we will automatically parse the text and generate clickable links for all URLs and eMail addresses in the document text. Defaults tofalse
.
-
isCopyPasteEnabled
abstract boolean isCopyPasteEnabled()
Whether copy and paste operations are enabled for annotations. If
true
we will show copy and cut actions in the editing annotation toolbar. Defaults totrue
.- Returns:
true
if copy/paste is enabled,false
otherwise.
-
getEnabledCopyPasteFeatures
abstract EnumSet<CopyPasteFeatures> getEnabledCopyPasteFeatures()
The enabled CopyPasteFeatures. Defaults to all features being enabled.
-
isUndoEnabled
abstract boolean isUndoEnabled()
Whether undoing edits is enabled. If
true
we will show undo actions in the toolbar. Defaults totrue
.- Returns:
true
if undo is enabled,false
otherwise.
-
isRedoEnabled
abstract boolean isRedoEnabled()
Whether redoing undone edits is enabled. If
true
we will show redo actions in the toolbar. Defaults totrue
,- Returns:
true
if redo is enabled,false
otherwise.
-
getAnnotationReplyFeatures
@NonNull() abstract AnnotationReplyFeatures getAnnotationReplyFeatures()
Which parts of the annotation replies UI are enabled.
- Returns:
One of AnnotationReplyFeatures to indicate the enabled features.
-
getFixedLowResRenderPixelCount
@Nullable() abstract Integer getFixedLowResRenderPixelCount()
Returns fixed low resolution render pixel count or
null
.- Returns:
fixed low resolution render pixel count.
-
isMultithreadedRenderingEnabled
abstract boolean isMultithreadedRenderingEnabled()
Controls whether multithreaded rendering is enabled, defaults to
true
.- Returns:
true
when multithreaded rendering is enabled,false
otherwise.
-
getSignaturePickerOrientation
@NonNull() abstract SignaturePickerOrientation getSignaturePickerOrientation()
The orientation to use for the signature picker, defaults to AUTOMATIC.
- Returns:
Orientation to use for the signature picker.
-
getSignatureSavingStrategy
@NonNull() abstract SignatureSavingStrategy getSignatureSavingStrategy()
The saving strategy used when adding signatures. When the Electronic Signature component is available, saving defaults to NEVER_SAVE. Meanwhile, if the license used is still on legacy signatures, the property will default to SAVE_IF_SELECTED.
- Returns:
The currently used signature saving strategy.
-
getSignatureColorOptions
@NonNull() abstract SignatureColorOptions getSignatureColorOptions()
Defines the signature color options available when using the "Draw" or "Type" signing UI. Defaults to black, purple, and blue.
- Returns:
Returns the SignatureColorOptions.
-
getSignatureCreationModes
@NonNull()@Size(min = 1, max = 3) abstract List<SignatureCreationMode> getSignatureCreationModes()
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.
- Returns:
Returns the configured signature creation modes.
-
getSignatureAppearance
@Nullable() abstract SignatureAppearance getSignatureAppearance()
Defines the appearance of the digital signature that is added after digitally signing a document. The signature appearance to use or
null
to use the default appearance.
-
isNoteAnnotationNoZoomHandlingEnabled
abstract boolean isNoteAnnotationNoZoomHandlingEnabled()
Whether handling for NOZOOM flag for note annotations is enabled.
Note: Note annotations are always displayed as if NOZOOM flag was set by default - i.e. they won't scale with page.
- Returns:
true
if note annotations should respect missing NOZOOM flag and should scale with page when it's not set.false
to prevent note annotations scaling with page.
-
isJavaScriptEnabled
abstract boolean isJavaScriptEnabled()
Controls whether JavaScript processing is enabled. 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.
- Returns:
true
if JavaScript is processing is enabled.
-
isTextSelectionPopupToolbarEnabled
abstract boolean isTextSelectionPopupToolbarEnabled()
Whether the text selection popup toolbar is enabled or not. If disabled and used by some com.pspdfkit.ui.PdfActivity, the activity will fall back to using the old text selection toolbar.
- Returns:
true
is text selection popup toolbar is enabled,false
otherwise.
-
isAnnotationPopupToolbarEnabled
abstract boolean isAnnotationPopupToolbarEnabled()
Whether the annotation popup toolbar is enabled or not. This appears when you long press a selected annotation
- Returns:
true
if enabled,false
if disabled.
-
getEnabledShareFeatures
@NonNull() abstract EnumSet<ShareFeatures> getEnabledShareFeatures()
Indicates which supported share features are enabled in the UI.
- Returns:
Set of enabled ShareFeatures.
-
allowMultipleBookmarksPerPage
abstract boolean allowMultipleBookmarksPerPage()
Indicates whether multiple bookmarks per page can be added or not, defaults to
false
. If disabled only one bookmark will be allowed to be added per page, otherwise multiple bookmarks can be added.
-
scrollOnEdgeTapEnabled
abstract boolean scrollOnEdgeTapEnabled()
Indicates whether tapping on the page edge causes the page to scroll. Defaults to
true
enabling navigating the document by tapping the page edges.
-
animateScrollOnEdgeTaps
abstract boolean animateScrollOnEdgeTaps()
Indicates whether page changes triggered by tapping the page edge cause an animation. Defaults to
false
disabling page change animations when changing the page by tapping the page edge.
-
scrollOnEdgeTapMargin
abstract int scrollOnEdgeTapMargin()
The margin in DP in which taps on the page edge trigger page navigation. Defaults to
24dp
.
-
isMagnifierEnabled
abstract boolean isMagnifierEnabled()
Indicates whether the magnifier is shown when: - The text selection handles are touched. - The measurement annotations are created. Defaults to
true
.
-
showSignHereOverlay
abstract boolean showSignHereOverlay()
Indicates whether the sign here overlay is shown on signature form fields. Defaults to
true
.
-
showNoteEditorForNewNoteAnnotations
abstract boolean showNoteEditorForNewNoteAnnotations()
Indicates whether the NoteEditor should be shown automatically when creating new note. Defaults to
true
.
-
enableStylusOnDetection
abstract 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
-
getOutlineElementState
abstract OutlineElementState getOutlineElementState()
Indicates whether the outline elements expanded or collapsed.
-
-
-
-