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
| Parameter | Type | Description |
|---|---|---|
| pageIndex | number | Zero-based page index. |
| rotation | PageOrientation | 0, 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 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.setRotation(1, 0); // upright, whatever it was