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
| Parameter | Type | Description |
|---|---|---|
| from | number | Current zero-based index. |
| to | number | The 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 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.move(3, 0); // make page 4 the cover