Some test text!

Search
Hamburger Icon

Web / Guides

Remove annotation from document using JavaScript

Make sure you have Full API enabled in WebViewer.

To remove an annotation from a document.

async function main() {
  const doc = await PDFNet.PDFDoc.createFromURL(filename);
  const page = await doc.getPage(1);

  // remove by index
  await page.annotRemove(0);

  // remove by annotation
  const annotation = await page.getAnnot(0);
  await page.annotRemove(annotation);
}
PDFNet.runWithCleanup(main);

Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales