Global

Type Definitions




Type Definitions

AnnotationToolbarItemsCallbackOptions

The additional options that are passed to PSPDFKit.AnnotationToolbarItemsCallback.

Type:
  • Object
Properties:
Name Type Description
defaultAnnotationToolbarItems Array.<PSPDFKit.AnnotationToolbarItem>

The list of default items that are shown for this particular annotation.

hasDesktopLayout boolean

Whether the screen is in desktop layout.

ColorPreset

Type:
  • Object
Properties:
Name Type Description
color PSPDFKit.Color | null

The Color represented by this preset. Eg: new PSPDFKit.Color({ r: 255, g: 139, b: 94 }). null means transparent.

localization Localization

FontCallback(fontName)

On Standalone, this callback receives the name of a font to retrieve as an argument and you can return from it a Promise that resolves to a Blob with the font data to use.

See this guide to learn more.

Parameters:
Name Type Description
fontName string

The name specified on the same PSPDFKit.Font constructor.

Example

Create a custom font for retrieving "Arial.ttf"

new PSPDFKit.Font({
  name: "Arial.ttf",
  callback: name => fetch(`https://example.com/${name}`).then(r => r.blob());
})

LineCapPresets

Type:
  • "none" | "square" | "circle" | "diamond" | "openArrow" | "closedArrow" | "butt" | "reverseOpenArrow" | "reverseClosedArrow" | "slash"

Localization

Type:
  • Object
Properties:
Name Type Attributes Description
id string

Eg: 'purple'

defaultMessage string <nullable>

Default Localization message. Eg: 'Purple'

description string <nullable>

Description of the localization message. Eg: 'Purple Color'

Text

Type:
  • object
Properties:
Name Type Description
format string

The format of the text. Either plain or xhtml.

value string

The text value.