PDF Comments JSON Format Schema

Types

This section explains how to use type declarations in Instant JSON records.

The optional keys are specified as follows:

{ optionalKey?: value; }

To save traffic, these keys shouldn’t be included in the record if the value is undefined.

Comments

The Instant Comments component allows users to collaborate on and discuss parts of a document in real time. You can use the PSPDFKit Document Engine comments APIs to add and retrieve comments in a document:

// Example of an Instant JSON schema including a comment associated with the annotation identified by `rootId`:
{
	"type": "pspdfkit/comment",
	"v": 1,
	"rootId": "01F46WTF5X3J1WEN6J2YXWHHEW",
	"pageIndex": 0,
	"pdfObjectId": null,
	"creatorName": null,
	"createdAt": "2021-04-26T10:50:30.650Z",
	"updatedAt": "2021-04-26T10:50:30.650Z",
	"text": "This is a comment.",
	"customData": null
}
type Comment = {
  // The comment text.
  text: string
  // The name of the comment author.
  creatorName?: string,
  // The date of the comment creation.
  createdAt?: Timestamp,
  // The date of the last comment update.
  updatedAt?: Timestamp,
  // Custom attributes of the comment.
  customData?: { [key: string]: any }
}

Annotation Replies aren’t supported in Instant JSON.

For more information about the Instant JSON schema for annotations, please refer to the JSON Format Schema — Annotations guide.