PagesApi.delete()
Deletes a page. Refused with
INVALID_ARGUMENT when it would empty the document. Needs the edit-pages feature.methodStructuresince 1.0.0
Signature
delete(pageIndex: number, options?: SignedDocumentOptions): Promise<void>
Parameters
| Parameter | Type | Description |
|---|---|---|
| pageIndex | number | Zero-based page index. |
| options? | SignedDocumentOptions | { invalidateSignatures? }. |
Returns
Promise<void>
Throws
INVALID_ARGUMENT— a page index out of range, or deleting the only page.PAGE_ERROR— 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.delete(doc.pages.count - 1); // drop the last page