Web SDKv1.0.0

PagesApi.move()

Moves a page to a new index. Needs the edit-pages feature.
methodStructuresince 1.0.0

Signature

move(from: number, to: number, options?: SignedDocumentOptions): Promise<void>

Parameters

ParameterTypeDescription
fromnumberCurrent zero-based index.
tonumberThe index it should occupy afterwards.
options?SignedDocumentOptions{ invalidateSignatures? }.

Returns

Promise<void>

Throws

  • INVALID_ARGUMENT — a page index or the destination out of range.
  • PAGE_ERROR — the page could not be moved, or the page tree is nested too deeply.
  • FEATURE_NOT_LICENSED — the license lacks edit-pages.
  • DOCUMENT_CLOSED — the document has been closed.
  • INVALID_STATE — a certified document whose certification forbids it, unless options.invalidateSignatures; or a progressive document still downloading.

Example

TypeScript
await doc.pages.move(3, 0); // make page 4 the cover

More in PagesApi