Class: Comment

PSPDFKit.Comment

A text comment made by the user that stems from an existing root annotation.

Extends

  • Immutable.Record

Members

Methods




Members

(readonly) canSetGroup: boolean

This property defines whether the user has permission to edit the group of this comment. The value of this field depends on the set of collaboration permissions defined in the JWT token.

It is only available when collaboration permissions is enabled on Server-Backed deployments.

Type:
  • boolean

createdAt: Date

The time when the comment was created.

Type:
  • Date

creatorName: string

The name of the person who created the comment.

Type:
  • string

customData: object

Arbitrary JSON-serializable data the user can attach to the comment.

Type:
  • object

group: string

This property is used to define the permission scope for a particular comment.

It is only available when collaboration permissions is enabled on Server-Backed deployments.

Type:
  • string

id: InstantID

A unique identifier for the comment. When comment is created in the UI, the viewer has to generate a unique ID.

Type:
  • InstantID

(readonly) isDeletable: boolean

This property defines whether this comment can be deleted or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

It is only available when collaboration permissions is enabled on Server-Backed deployments.

Type:
  • boolean

(readonly) isEditable: boolean

This property defines whether this comment can be edited or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

It is only available when collaboration permissions is enabled on Server-Backed deployments.

Type:
  • boolean

pageIndex: number

The page index that this comment resides at.

Type:
  • number

pdfObjectId: number

If this comment is from the original PDF, then this ID is from that PDF note annotation that defined the comment.

Type:
  • number

rootId: InstantID

The ID of the annotation that this comment stems from. In PSPDFKit for Web, this should be either a PSPDFKit.Annotations.MarkupAnnotation or a PSPDFKit.Annotations.CommentMarkerAnnotation.

Type:
  • InstantID

text: Text

The text of the comment in xhtml/plain text format.

In case of XHTML, we support the following tags:

  • <b>: Bold
  • <i>: Italic
  • <span>: Font color, background color and underline using the style attribute (e.g. <span style="color: red; background-color: blue; text-decoration: underline">Hello</span>)
  • p: Paragraph. You can use this to add a newline between paragraphs.
  • a: Link. You can use this to add a link to the comment. The href attribute is required.
Type:

updatedAt: Date

The time when the comment was last updated.

Type:
  • Date

Methods

getMentionedUserIds() → {Immutable.Set.<string>}

A method that returns a set of user IDs that are mentioned in the comment.

Returns:

A immutable set of user IDs that are mentioned in the comment.

Type
Immutable.Set.<string>
Example
const ids = comment.getMentionedUserIds()

(static) fromSerializableObject() → {PSPDFKit.Comment}

Comment deserializer. Converts a comment object to a PSPDFKit.Comment.

Parameters:
Type Description
object
Returns:
Type
PSPDFKit.Comment

(static) toSerializableObject() → {object}

Comment serializer. Converts a comment to a InstantJSON compliant object.

Parameters:
Type Description
PSPDFKit.Comment
Returns:
Type
object