Web SDKv1.0.0

PagesApi.setRotation()

Sets the page's rotation outright. Needs the edit-pages feature.
methodStructuresince 1.0.0

Signature

setRotation(pageIndex: number, rotation: PageOrientation, options?: SignedDocumentOptions): Promise<void>

Parameters

ParameterTypeDescription
pageIndexnumberZero-based page index.
rotationPageOrientation0, 90, 180 or 270 clockwise degrees, as the file will hold it.
options?SignedDocumentOptions{ invalidateSignatures? }.

Returns

Promise<void>

Throws

  • INVALID_ARGUMENT — a page index out of range, or a rotation that is not 0, 90, 180 or 270.
  • 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.setRotation(1, 0); // upright, whatever it was

More in PagesApi