1async function main() {
2 const doc = await PDFNet.PDFDoc.createFromURL(filename);
3 const page = await doc.getPage(1);
4
5 // remove by index
6 await page.annotRemove(0);
7
8 // remove by annotation
9 const annotation = await page.getAnnot(0);
10 await page.annotRemove(annotation);
11}
12PDFNet.runWithCleanup(main);