Interface: ElectronicSignaturesConfiguration

PSPDFKit.ElectronicSignaturesConfiguration

Defines specific configuration options related to the electronic signatures feature.

Example

PSPDFKit.load({
  electronicSignatures: {
    creationModes: [PSPDFKit.ElectronicSignatureCreationMode.IMAGE],
    fonts: [new PSPDFKit.Font("mycustomfont")]
  }
});

Members




Members

(nullable) colorPresets: Array.<PSPDFKit.ColorPreset>

Optionally set color presets to be used in the Electronic Signatures dialog.

Type:
  • Array.<PSPDFKit.ColorPreset>
Example

Setting custom color presets for the Type Electronic Signature UI

 PSPDFKit.load({
  electronicSignatures: {
    colorPresets: [
      {
        color: Color.RED,
        localization: {
          id: 'red',
          defaultMessage: 'Red',
          description: 'Red color',
        },
      },
      {
        color: Color.ORANGE,
        localization: {
          id: 'orange',
          defaultMessage: 'Orange',
          description: 'Orange color',
        },
      },
      {
        color: Color.YELLOW,
        localization: {
          id: 'yellow',
          defaultMessage: 'Yellow',
          description: 'Yellow color',
        },
      },
    ],
  }
});

Array of tabs that should be offered to users on the electronic signatures modal.

Type:

fonts: Array.<PSPDFKit.Font>

Array of PSPDFKit.Font fonts that users can choose from when typing text for adding a new electronic signature.

You can specify any additional font to use on a custom style sheet set via PSPDFKit.Configuration#styleSheets via @font-face CSS at-rule.

When specifying the name of each PSPDFKit.Font record make sure that it matches the one specified on the style sheet.

Type:

(nullable) setDefaultTypeText: PSPDFKit.ElectronicSignatureDefaultTextCallback|string

Optionally set an initial default text for the Type Electronic Signature UI.

The default placeholder will be shown if the callback does not return a non-empty string, or is not set to a non-empty string.

Type:
Example

Setting a default text for the Type Electronic Signature UI

 PSPDFKit.load({
  electronicSignatures: {
   setDefaultTypeText: () => "My default text"
 }
});