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
This user defined function receives the AnnotationsUnion to be rendered as argument.
It must return a PSPDFKit.RendererConfiguration object or null.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
payload |
object | Annotation data Properties
|