Web SDKv1.0.0

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

ParameterTypeDescription
pageIndexnumberZero-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 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.delete(doc.pages.count - 1); // drop the last page

More in PagesApi