Builder

class Builder

Builder used to construct PdfActivityConfiguration instance.

Constructors

Link copied to clipboard
constructor(context: Context)

Creates a new com.pspdfkit.ui.PdfActivity configuration builder.

constructor(configuration: PdfActivityConfiguration)

Create a new builder from existing configuration.

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

Enable/disable the list of annotations.

Link copied to clipboard

Sets whether reordering annotations in the annotation list is enabled. This defaults to true.

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 AnnotationReplyFeatures.ENABLED, the replies can be added to note annotations and annotation notes. If AnnotationReplyFeatures.READ_ONLY, the replies can be looked at but none can be added or modified. If AnnotationReplyFeatures.DISABLED, the reply UI is disabled entirely. This feature is only UI specific, defining the replies availability in the com.pspdfkit.ui.PdfFragment's UI. The API for retrieving and adding replies still works even if this property is AnnotationReplyFeatures.DISABLED.

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 autosaving of modified PDF documents. This is enabled by default.

Link copied to clipboard

Sets color of PDF background. Color#WHITE by default.

Link copied to clipboard

Enable/disable editing controls on the bookmarks list.

Link copied to clipboard

Enable/disable the display of bookmarks.

Link copied to clipboard
Link copied to clipboard

Replaces all properties from the PdfConfiguration

Link copied to clipboard

Enable/disable content editing functionality.

Link copied to clipboard

Enable/disable copy and paste of annotations.

Link copied to clipboard

Enable/disable default toolbar.

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 the list of annotations.

Link copied to clipboard

Disables annotation rotation functionality.

Link copied to clipboard

Disabled editing controls on the bookmarks list.

Link copied to clipboard

Disables the display of bookmarks.

Link copied to clipboard

Disables content editing functionality.

Link copied to clipboard

Disables copy and paste of annotations.

Link copied to clipboard
Link copied to clipboard

Disables document editing functionality in the page grid.

Link copied to clipboard

Disables the document info view.

Link copied to clipboard

Disables the embedded files menu in the activity.

Link copied to clipboard

Disables form editing functionality.

Link copied to clipboard

Disables outline menu in the activity.

Link copied to clipboard

Hides printing option in the sharing menu even if printing can be done on the device.

Link copied to clipboard

Disables document search functionality.

Link copied to clipboard

Enable/disable document editing functionality in the page grid.

Link copied to clipboard

Enable/disable document info view.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

Enables the embedded files menu in the activity.

Link copied to clipboard

Enables annotation editing functionality.

Link copied to clipboard

Enables the list of annotations.

Link copied to clipboard

Enables annotation rotation functionality.

Link copied to clipboard

Enables editing controls on the bookmarks list.

Link copied to clipboard

Enables the display of bookmarks.

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
Link copied to clipboard

Enables document editing functionality in the page grid.

Link copied to clipboard

Enables the document info view.

Link copied to clipboard

Enables the embedded files menu in the activity.

Link copied to clipboard

Enables form editing functionality.

Link copied to clipboard

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

Link copied to clipboard

Enables outline menu in the activity.

Link copied to clipboard

Enables printing option in the menu if applicable for the document and the device.

Link copied to clipboard

Sets whether we enable the reader view in the activity or not. It includes also the icon in the main toolbar. It requires the Reader View license to work. Defaults to false.

Link copied to clipboard

Enables document search functionality.

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. Valid modes are PageFitMode.FIT_TO_SCREEN which will try to fit pages into the device's screen, or PageFitMode.FIT_TO_WIDTH which will fit the page so that it's width matches the device's screen width.

Forces the signature button to show up in the main toolbar. The button's visibility in the main toolbar default to false when the license uses Annotation Editing, as normally the annotation signature creation can be accessed via the Annotation Creation Toolbar. For the special case where the license includes Electronic Signatures without Annotation Editing, the signature button will be included in the main toolbar rather than in the Annotation Creation Toolbar. Throws when license does not support using Electronic Signatures.

Link copied to clipboard

Enable/disable form editing functionality.

Link copied to clipboard

Hides the overlay displaying the document title.

Link copied to clipboard

Hides the navigation buttons.

Link copied to clipboard

Hides page labels (if any).

Link copied to clipboard

Hides the overlay displaying currently selected page.

Link copied to clipboard

Hides the settings menu icon.

Link copied to clipboard

Hides the actionbar icon to show grid of thumbnail pages.

Link copied to clipboard

Sets to automatically hide user interface controls when annotation creation toolbar position is in vertical position (left/right). Changing toolbar's position to top restores user interface visibility. This options is valid only for UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_AUTOMATIC and UserInterfaceViewMode.USER_INTERFACE_VIEW_MODE_AUTOMATIC_BORDER_PAGES.

Link copied to clipboard

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

Link copied to clipboard

Sets a layoutRes used by the launched activity. When using this, make sure that the selected layout contains all the required views. This defaults to R.layout.pspdf__pdf_activity.

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 the annotation types that should be displayed in the annotation list. By default, all types are displayed except AnnotationType.LINK.

Link copied to clipboard

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

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

Sets the maximum zoom scale at which the document should be displayed. Make sure this value is higher than defaultZoomScale. Defaults to com.pspdfkit.ui.PdfFragment.MAX_ZOOM.

Link copied to clipboard

Sets size of memory cache for rendered pages and bitmaps. Defaults to 1/4 of available heap size of the app.

Link copied to clipboard

Show/hide the navigation buttons.

Link copied to clipboard

Enable/disable outline menu in the activity.

Link copied to clipboard
fun page(@IntRange(from = 0) pageIndex: Int): PdfActivityConfiguration.Builder

Sets the page to start the document at. Default value is 0.

Link copied to clipboard

Show/hide page labels (if any).

Link copied to clipboard

Show/hide the overlay displaying currently selected page.

Link copied to clipboard

Sets the padding between pages. Defaults to 16dp.

Link copied to clipboard

Enable/disable printing option in the menu if applicable for the document and the device.

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 the scrolling direction (i.e. the orientation) for the document. This defaults to PageScrollDirection.HORIZONTAL.

Link copied to clipboard

Sets the scrolling mode. Currently supported scrolling modes are PageScrollMode.PER_PAGE (also called paginated scroll mode) which will snap in pages, and PageScrollMode.CONTINUOUS which will not snap in to pages, but allow to scroll continuously.

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 configuration used for searching, applied to search views.

Link copied to clipboard

Enable/disable document search functionality.

Link copied to clipboard

Enables or disables resize guides. This defaults to true.

Enables or disables font scaling. This defaults to true.

Link copied to clipboard

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

Link copied to clipboard

Enables or disables visual indicator shown for annotations that have annotation notes.

Link copied to clipboard

The documeninfo view is now by default in a separate window and no longer in the outlineview. If you want to keep the old behaviour with the document info in the outline view, call this method with false

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 com.pspdfkit.ui.PdfActivity. The sharing API still works even if certain 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

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

Sets whether we show the UI to apply redactions when there are com.pspdfkit.annotations.RedactionAnnotation in the document or not. Defaults to true.

Link copied to clipboard

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.

Link copied to clipboard

Sets how aggressively the resize guides works.

Link copied to clipboard

Sets the search type (if search is enabled).

Link copied to clipboard

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

Link copied to clipboard

Sets the items to show in the settings menu. By default all the items are shown. If none are shown the settings menu icon will not be shown either.

Link copied to clipboard

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

Link copied to clipboard

Configures the tab bar hiding mode.

Link copied to clipboard

Sets the thumbnail bar mode.

Link copied to clipboard

Show/hide the settings menu icon.

Link copied to clipboard

Sets the user interface view mode.

Link copied to clipboard

Enables or disables volume buttons navigation. This is disabled by default.

Link copied to clipboard

Shows overlay displaying the document title.

Link copied to clipboard

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

Link copied to clipboard

Shows the navigation buttons.

Link copied to clipboard

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

Link copied to clipboard

Enables display of the page labels (if any).

Link copied to clipboard

Shows overlay displaying current page number over document.

Link copied to clipboard

Shows the settings menu icon.

Link copied to clipboard

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

Link copied to clipboard

Displays an actionbar icon to show grid of thumbnail pages.

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

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

Link copied to clipboard

Signature saving strategy used within the dialog when adding signatures. Defaults to SignatureSavingStrategy.SAVE_IF_SELECTED. This will only work if a com.pspdfkit.signatures.storage.SignatureStorage has been created and set via com.pspdfkit.ui.PdfFragment.setSignatureStorage, otherwise SignatureSavingStrategy.NEVER_SAVE will be used.

Link copied to clipboard

Sets the start scale at which the document will be displayed. Defaults to com.pspdfkit.ui.PdfFragment.DEFAULT_ZOOM.

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

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 a themeRes used to override default activity theme.

Link copied to clipboard

Sets a themeDarkRes used to override dark activity theme.

Link copied to clipboard

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

Link copied to clipboard

Show/hide the actionbar icon to show grid of thumbnail pages.

Link copied to clipboard

Sets the actionbar activity title. If not set (or null), PSPDFKit will extract the title from the loaded PDF document.

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

Enabled immersive fullscreen mode in the activity. Note that this feature is only natively supported from Android 4.4 and newer, before that a FullScreen theme will have to be applied to PSPDFKit activity. This defaults to false.

Link copied to clipboard

Enables or disables video playback. This is disabled by default.

Link copied to clipboard

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