Builder

class Builder

Builder used to construct PdfConfiguration instance.

Constructors

Link copied to clipboard
constructor(configuration: PdfConfiguration)

Create a new builder from existing configuration.

constructor()

Properties

Link copied to clipboard

The ways in which the user can choose to add their signature.

Functions

Link copied to clipboard

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.

Link copied to clipboard

Sets whether page changes triggered by tapping the page edge cause an animation. Defaults to false making the transition instant.

Link copied to clipboard

Enable/disable annotation editing functionality.

Link copied to clipboard

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.

Link copied to clipboard

Configures which part of the annotation replies UI is enabled. If , 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 PdfFragment's UI. The API for retrieving and adding replies still works even if this property is AnnotationReplyFeatures.DISABLED.

Link copied to clipboard

Enable/disable annotation rotation functionality.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Enable/disable functionality that automatically selects next form element. Disabled by default.

Link copied to clipboard

Sets color of PDF background. White by default.

Link copied to clipboard

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

Link copied to clipboard

Enable/disable content editing functionality.

Link copied to clipboard

Enable/disable copy and paste of annotations.

Link copied to clipboard

Disables annotation editing functionality.

Link copied to clipboard

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.

Link copied to clipboard

Disables annotation rotation functionality.

Link copied to clipboard

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

Link copied to clipboard

Disables content editing functionality.

Link copied to clipboard

Disables copy and paste of annotations.

Link copied to clipboard

Disables form editing functionality.

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.

Link copied to clipboard

Sets a list of annotation types that can be selected on page and edited.

Link copied to clipboard

Enables annotation editing functionality.

Link copied to clipboard

Enables annotation rotation functionality.

Link copied to clipboard

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

Link copied to clipboard

Enables content editing functionality.

Link copied to clipboard

Enables copy and paste of annotations.

Link copied to clipboard

Sets a list of annotation tools that are enabled.

Link copied to clipboard

Enables form editing functionality.

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.

Link copied to clipboard

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

Link copied to clipboard

Sets a list of annotation types that will be excluded from rendering.

Link copied to clipboard

Sets whether the first page should always be displayed as a single or not. This is notable only if double page mode is active.

Link copied to clipboard

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

Link copied to clipboard

Enable/disable form editing functionality.

Link copied to clipboard

Enables/Disables date and time picker for form elements. Enabled by default.

Link copied to clipboard

Sets if the colors will be inverted in the document. This is disabled by default.

Link copied to clipboard

Sets the page layout mode, or how the document will layout the pages (as single pages, double pages or automatically).

Link copied to clipboard

Sets a drawable for loading progress throbber while document is loaded.

Link copied to clipboard

Sets whether the magnifier is shown when text selection handles are touched. Defaults to true.

Link copied to clipboard
fun maxZoomScale(@FloatRange(from = 1.0, to = 20.0) scale: Float): PdfConfiguration.Builder

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

Link copied to clipboard

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.

Link copied to clipboard

Sets the padding between pages. Defaults to 16dp.

Link copied to clipboard
fun playingMultipleMediaInstancesEnabled(playingMultipleMediaInstancesEnabled: Boolean): PdfConfiguration.Builder

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

Enable/disable 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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Sets the document scrollbars to be enabled or disabled.

Link copied to clipboard

Sets scrolling direction for the document.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

Margin in dp in which taps on the edge of the page will trigger the page navigation. Defaults to 24dp.

Link copied to clipboard

Sets whether the annotation inspector is enabled. This defaults to true.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
fun setFixedLowResRenderPixelCount(fixedLowResRenderPixelCount: Int?): PdfConfiguration.Builder

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.

Link copied to clipboard

Enables or disables JavaScript processing. Defaults to true.

Link copied to clipboard

Enables or disables measurement tools functionality.

Link copied to clipboard

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

Link copied to clipboard

Sets whether outline elements are expanded or collapsed.

Link copied to clipboard
fun setResizeGuideLineIntervals(@Size(min = 2, multiple = 2) intervals: List<Float>): PdfConfiguration.Builder

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].

Link copied to clipboard

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

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

Link copied to clipboard

Enable or disable resizing of selected annotations. This defaults to true.

Link copied to clipboard

Enables or disables resize guides. This defaults to true.

Link copied to clipboard

Sets the orientation to use for the signature picker. Defaults to .

Link copied to clipboard

Sets whether to show gao between pages in double page mode or not.

Link copied to clipboard
fun showNoteEditorForNewNoteAnnotations(showNoteEditorForNewNoteAnnotations: Boolean): PdfConfiguration.Builder

Sets whether the note editor should be started automatically for newly created note annotations. Defaults to true.

Link copied to clipboard

Sets whether the sign here overlay is shown inside of signature form fields. Defaults to true.

Link copied to clipboard

Defines the 3 signature color options available when using the Electronic Signatures "Draw" or "Type" signing UI. Defaults to black, purple, and blue.

Link copied to clipboard
fun signatureCreationModes(@Size(min = 1, max = 3) signatureCreationModes: List<SignatureCreationMode>): PdfConfiguration.Builder

The ways in which the user can choose to add their signature.

Link copied to clipboard

Defines if a signature should be saved after creation. When the Electronic Signature component is available, saving defaults to SignatureSavingStrategy.NEVER_SAVE. If the license used is on Legacy Signatures, the property will default to SignatureSavingStrategy.SAVE_IF_SELECTED.

Link copied to clipboard

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

Link copied to clipboard

Enables or disables text selection (both programmatically and via long-press gesture). This is enabled by default.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Sets if the colors will be converted to grayscale. This is disabled by default.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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