Namespace: Options

PSPDFKit.Options

Custom values for default options. These values will be frozen the first time PSPDFKit.load is called, and won't be modifiable after that.

Example

Set minimum ink annotation size.

PSPDFKit.Options.MIN_INK_ANNOTATION_SIZE = 64;
PSPDFKit.load();

Members

Type Definitions




Members

DEFAULT_INK_ERASER_CURSOR_WIDTH: number

Set the default width of the ink eraser cursor.

Type:
  • number
Default Value:
  • false

DISABLE_KEYBOARD_SHORTCUTS: boolean

Disable all the PSPDFKit keyboard shortcuts.

Type:
  • boolean
Default Value:
  • false

ENABLE_INK_SMOOTH_LINES: boolean

Enable smooth lines for ink annotations.

Type:
  • boolean
Default Value:
  • true

IGNORE_DOCUMENT_PERMISSIONS: boolean

Enables all the features by ignoring the document permissions.

Type:
  • boolean
Default Value:
  • false

INITIAL_DESKTOP_SIDEBAR_WIDTH: number

The default width of the sidebar on desktop browsers.

Type:
  • number
Default Value:
  • 300

INK_EPSILON_RANGE_OPTIMIZATION: number

Minimum range between two points for an ink annotation, in pixels. If set to 0, the optimization is disabled.

Type:
  • number
Default Value:
  • 10

MIN_IMAGE_ANNOTATION_SIZE: number

Minimum size of image annotations, in pixels.

Type:
  • number
Default Value:
  • 5

MIN_INK_ANNOTATION_SIZE: number

Minimum size of ink annotations, in pixels.

Type:
  • number
Default Value:
  • 16

MIN_SHAPE_ANNOTATION_SIZE: number

Minimum size of shape annotations, in pixels.

Type:
  • number
Default Value:
  • 16

MIN_STAMP_ANNOTATION_SIZE: number

Minimum size of stamp annotations, in pixels.

Type:
  • number
Default Value:
  • 15

MIN_TEXT_ANNOTATION_SIZE: number

Minimum size of text annotations, in pixels.

Type:
  • number
Default Value:
  • 5

PDF_JAVASCRIPT: boolean
Standalone Only

Enables PDF JavaScript support. PDF documents may contain JavaScript for interactivity. This enables things like form validation, formatting, or automatic calculation which are performed by a JavaScript scripts inside the PDF document.

Disabling JavaScript improves the general performance of the framework when PDF JavaScript support is not needed.

This feature is only available on standalone deployments for now.

Type:
  • boolean
Default Value:
  • false

Defines the radius of the resize anchors in px.

Type:

Defines the padding between the annotation and the selection outline on px.

Type:

SELECTION_STROKE_WIDTH: number

Stroke width of the selection outline rectangle in px.

Type:
  • number
Default Value:
  • 2

SIGNATURE_SAVE_MODE: PSPDFKit.SignatureSaveMode

Saving strategy for ink signatures.

Type:
Default Value:
  • PSPDFKit.SignatureSaveMode.USING_UI

TEXT_ANNOTATION_AUTOFIT_BOUNDING_BOX_ON_EDIT: boolean

Control whether PSPDFKit should adjust the text annotations' bounding box to fit the text in the annotation when editing it.

Type:
  • boolean
Default Value:
  • true

TEXT_ANNOTATION_AUTOFIT_TEXT_ON_EXPORT: boolean

Control whether PSPDFKit should adjust the font size to fit the text in the annotation bounding box when exporting the annotation.

Type:
  • boolean
Default Value:
  • true

Type Definitions

ResizeAnchorRadiusCallback(viewportSize) → {number}

Receives a PSPDFKit.Geometry.Size object with the current viewport dimensions (width and height) and returns the radius of the selection resize / modification anchors in px.

The default implementation will increase the anchor radius on small device.

Parameters:
Name Type Description
viewportSize PSPDFKit.Geometry.Size
Returns:
Type
number

SelectionOutlinePaddingCallback(viewportSize) → {number}

Receives a PSPDFKit.Geometry.Size object with the current viewport dimensions (width and height) and returns the padding that will be added between an annotation and the selection outline in px.

The default implementation will increase the outline padding on small device.

Parameters:
Name Type Description
viewportSize PSPDFKit.Geometry.Size
Returns:
Type
number