Web SDKv1.0.0

PagesApi.rotate()

Turns the page by by clockwise degrees from where it stands. Needs the edit-pages feature.
methodStructuresince 1.0.0

Signature

rotate(pageIndex: number, by: PageTurn, options?: SignedDocumentOptions): Promise<void>

Parameters

ParameterTypeDescription
pageIndexnumberZero-based page index.
byPageTurnClockwise degrees from where the page stands: 90, 180, 270, or negative for counter-clockwise.
options?SignedDocumentOptions{ invalidateSignatures? }.

Returns

Promise<void>

Throws

  • INVALID_ARGUMENT — a page index out of range, or by is 0 or anything but a multiple of 90.
  • PAGE_ERROR — the page could not be loaded.
  • 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.rotate(0, 90);
await doc.pages.rotate(1, -90); // counter-clockwise

More in PagesApi