DocsEnginesAnnotationsRemove Page Annotation

removePageAnnotation

Deletes an existing annotation from a specified page.

Signature

removePageAnnotation( doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject ): PdfTask<boolean>;

Description

This method finds and permanently removes an annotation from the PDF document in memory. The annotation is identified by its id property.

To persist this change, you must call saveAsCopy to generate a new PDF file without the deleted annotation.

Parameters

NameTypeDescription
docPdfDocumentObjectThe handle of the document to modify.
pagePdfPageObjectThe page where the annotation exists.
annotationPdfAnnotationObjectThe annotation object to remove. Only the id property is used for identification.

Returns

PdfTask<boolean>

A Task that resolves with true if the annotation was successfully found and removed.

Example

// Assuming 'engine', 'document', and 'page' are available async function deleteAnnotation(annotationToDelete) { try { const success = await engine.removePageAnnotation(document, page, annotationToDelete).toPromise(); if (success) { console.log(`Annotation ${annotationToDelete.id} was successfully removed.`); // Re-render the page to reflect the change } } catch (error) { console.error('Failed to remove annotation:', error); } }

See Also

Last updated on October 8, 2025

Need Help?

Join our community for support, discussions, and to contribute to EmbedPDF's development.