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
PSPDFKit.Options.MIN_INK_ANNOTATION_SIZE = 64;
PSPDFKit.load();
Members
Type Definitions
Members
Internally our breakpoint logic is applied to singular toolbar buttons, not to the whole main toolbar. The next two members allow to set custom breakpoints to control the toolbar buttons responsive mode.
Specifies a viewport width breakpoint for medium screens used by some toolbar buttons to switch to responsive mode.
Type:
- number
- Default Value:
- BREAKPOINT_MD_TOOLBAR: 1070 //px,
Specifies a viewport width breakpoint for small screens used by some toolbar buttons to switch to responsive mode.
Type:
- number
- Default Value:
- BREAKPOINT_SM_TOOLBAR: 768, //px,
The list of colors to use for color dropdowns in annotation toolbars.
Type:
- Array.<ColorPreset>
- Deprecated
- Default Value:
- Red, Orange, Yellow, Green, Blue, Purple, Pink, Light Orange, Light Yellow, Light Green, Light Blue, Mauve, Transparent, White, Light Grey, Grey, Dark Grey, Black
Example
PSPDFKit.Options.COLOR_PRESETS = [
{
color: new PSPDFKit.Color({ r: 255, g: 0, b: 0 }),
localization: {
id: "brightRed",
defaultMessage: "Bright Red"
}
},
{
color: new PSPDFKit.Color({ r: 0, g: 0, b: 180 }),
localization: {
id: "deepBlue",
defaultMessage: "Deep Blue"
}
},
{
color: new PSPDFKit.Color({ transparent: true }),
localization: {
id: "transparent",
defaultMessage: "Transparent"
}
}
];
Set the default width of the ink eraser cursor.
Note: setting the default width of the ink eraser cursor using this setting is now deprecated. Use the inkEraserWidth
property of the ink
annotation preset instead.
Type:
- number
- Deprecated
- Default Value:
- false
Disable all the PSPDFKit keyboard shortcuts.
Type:
- boolean
- Default Value:
- false
Enable smooth lines for ink annotations.
Type:
- boolean
- Default Value:
- true
The list of colors to use in the text highlight annotation toolbar. You can't use transparent for this.
Type:
- Array.<ColorPreset>
- Default Value:
- Light Yellow, Light Blue, Light Green, Light Red
Example
PSPDFKit.Options.HIGHLIGHT_COLOR_PRESETS = [
{
color: new PSPDFKit.Color({ r: 255, g: 0, b: 0 }),
localization: {
id: "brightRed",
defaultMessage: "Bright Red"
}
},
{
color: new PSPDFKit.Color({ r: 0, g: 0, b: 180 }),
localization: {
id: "deepBlue",
defaultMessage: "Deep Blue"
}
}
];
Enables all the features by ignoring the document permissions.
Type:
- boolean
- Default Value:
- false
The default width of the sidebar on desktop browsers.
Type:
- number
- Default Value:
- 300
Minimum range between two points for an ink annotation, in pixels. If set to 0, the optimization is disabled.
Type:
- number
- Default Value:
- 10
The list of line caps to use for dropdowns in annotation toolbars.
Type:
- Array.<LineCapPresets>
- Default Value:
- ["none", "square", "circle", "diamond", "openArrow", "closedArrow", "butt", "reverseOpenArrow", "reverseClosedArrow", "slash"]
Example
PSPDFKit.Options.LINE_CAP_PRESETS = ["openArrow", "closedArrow", "none"];
The list of line widths to use for dropdowns in annotation toolbars.
Type:
- Array.<number>
- Default Value:
- null
Example
PSPDFKit.Options.LINE_WIDTH_PRESETS = [1, 2, 4, 8, 32];
Minimum size of image annotations, in pixels.
Type:
- number
- Default Value:
- 5
Minimum size of ink annotations, in pixels.
Type:
- number
- Default Value:
- 16
Minimum size of shape annotations, in pixels.
Type:
- number
- Default Value:
- 16
Minimum size of stamp annotations, in pixels.
Type:
- number
- Default Value:
- 15
Minimum size of text annotations, in pixels.
Type:
- number
- Default Value:
- 5
Minimum size of widget annotations, in pixels.
Type:
- number
- Default Value:
- 3
The list of colors to use for note annotations. You can't pass transparent color as an option.
Type:
- Array.<ColorPreset>
- Default Value:
- Yellow, Orange, Red, Fuchsia, Blue, Green
Example
PSPDFKit.Options.NOTE_COLOR_PRESETS = [
{
color: new PSPDFKit.Color({ r: 255, g: 0, b: 0 }),
localization: {
id: "brightRed",
defaultMessage: "Bright Red"
}
},
{
color: new PSPDFKit.Color({ r: 0, g: 0, b: 180 }),
localization: {
id: "deepBlue",
defaultMessage: "Deep Blue"
}
}
}
];
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:
- true
Defines the radius of the resize anchors in px.
Type:
Defines the padding between the annotation and the selection outline on px.
Type:
Stroke width of the selection outline rectangle in px.
Type:
- number
- Default Value:
- 2
Saving strategy for ink signatures.
Type:
- Default Value:
- PSPDFKit.SignatureSaveMode.USING_UI
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
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
The list of colors to use in the text markup annotation toolbar.
Type:
- Array.<ColorPreset>
- Default Value:
- Black, Blue, Red, Green
Example
PSPDFKit.Options.TEXT_MARKUP_COLOR_PRESETS = [
{
color: new PSPDFKit.Color({ r: 255, g: 0, b: 0 }),
localization: {
id: "brightRed",
defaultMessage: "Bright Red"
}
},
{
color: new PSPDFKit.Color({ r: 0, g: 0, b: 180 }),
localization: {
id: "deepBlue",
defaultMessage: "Deep Blue"
}
}
];
Type Definitions
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
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