Global

Type Definitions




Type Definitions

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'