Web SDKv1.0.0

AttachmentsApi.delete()

Delete an embedded file by its index; refused on a certified document the same way as add(). Needs the edit-pages feature.
methodEditingsince 1.0.0

Signature

delete(index: number, options?: SignedDocumentOptions): Promise<void>

Parameters

ParameterTypeDescription
indexnumberThe attachment's index, as list() reports it.
options?SignedDocumentOptions{ invalidateSignatures? }.

Returns

Promise<void>

Throws

  • INVALID_ARGUMENT — an index that names no attachment.
  • PAGE_ERROR — the attachment could not be removed.
  • FEATURE_NOT_LICENSED — the license lacks edit-pages.
  • DOCUMENT_CLOSED — the document has been closed.
  • INVALID_STATE — a certified document, unless options.invalidateSignatures; or a progressive document still downloading.

Example

TypeScript
await doc.attachments.delete(index);

More in AttachmentsApi