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
| Parameter | Type | Description |
|---|---|---|
| pageIndex | number | Zero-based page index. |
| by | PageTurn | Clockwise 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, orbyis0or anything but a multiple of 90.PAGE_ERROR— the page could not be loaded.FEATURE_NOT_LICENSED— the license lacksedit-pages.DOCUMENT_CLOSED— the document has been closed.INVALID_STATE— a certified document whose certification forbids it, unlessoptions.invalidateSignatures; or a progressive document still downloading.
Example
TypeScript
await doc.pages.rotate(0, 90); await doc.pages.rotate(1, -90); // counter-clockwise