Class: Attachment

PSPDFKit.Attachment

Attachments are data that can be attached to annotations. An example for such an attachment is an image attachment in an image annotation.

It is an Immutable.Record and thus can be updated using set(key, value), for example: attachment.set("data", new Blob(...)).

Constructor

new PSPDFKit.Attachment(args)

An attachment, that can hold the data as a Blob.

Parameters:
Name Type Description
args object

An ArrayBuffer, which be used as the data of the attachment.

Default Value:
  • { data: null }
Example
fetch("https://example.com/my-image.jpg")
  .then(r => r.blob())
  .then(blob => instance.createAttachment(blob))
  .then(attachmentId => console.log(attachmentId));

Extends

  • Immutable.Record

Members




Members

data: Blob

The attachment's data as a Blob.

Type:
  • Blob
Default Value:
  • null