Web SDKv1.0.0

AnnotationsApi.list()

Every annotation on a page as AnnotationInfo[]. An id is the annotation's name — a UUID for one the SDK created — or obj:<number> for one the file carries without a name. Without the extract feature contents, author and a web link's uri are ''. A link's uri is the address the viewer would follow (http:, https:, mailto:, tel:, as create() takes it — a bare host in the file reads with https:// in front); a link with any other scheme has uri and targetPage both null. created and modified are Dates, null where a file from another producer says nothing or writes something that is not a PDF date. Needs no feature.
methodAnnotationssince 1.0.0

Signature

list(pageIndex: number): Promise<AnnotationInfo[]>

Parameters

ParameterTypeDescription
pageIndexnumberZero-based page index.

Returns

Promise<AnnotationInfo[]> Each with pageIndex, id, type, rect, contents, author, color, opacity, fillColor, created, modified, quads, inkList, vertices, line, lineEndings, strokeWidth, uri, targetPage, flags, inReplyTo and status.

Throws

  • INVALID_ARGUMENT — a page index out of range.
  • DOCUMENT_CLOSED — the document has been closed.

Example

TypeScript
const links = (await doc.annotations.list(0)).filter((a) => a.type === 'link');

More in AnnotationsApi