Interface: CustomRenderers

PSPDFKit.CustomRenderers

This object can include functions to be called when specific entities, like annotations, are being rendered in the viewport, and return additional or replacement DOM content for the entity instance.

Currently only annotation's rendering can be customized using the Annotation key.

If the callback returns null, the instance will be rendered normally.

Example

PSPDFKit.load({
  customRenderers: {
    Annotation: annotation => ({
      node: document.createElement("div").appendChild(document.createTextNode("Custom rendered!")),
      append: true,
    })
  }
  // ...
});

Members

Type Definitions




Members

Annotations custom renderer callback.

Type:

Type Definitions

AnnotationCustomRendererCallback(annotation) → {PSPDFKit.AnnotationRenderConfiguration}

This user defined function receives the PSPDFKit.Annotations.Annotation to be rendered as argument.

It must return a PSPDFKit.AnnotationRenderConfiguration object or null.

Parameters:
Name Type Description
annotation PSPDFKit.Annotations.Annotation
Returns:
Type
PSPDFKit.AnnotationRenderConfiguration