Fetch comments, geometry on which comment is applied, giving error [the object no longer exists]
I am using indesign version 20.0.0 ans UXP verison 8.0.1.
I want to fetch the location of comment in pdf where it is applied.
PdfComment's property commentPathGeometry is giving error.
Exception: Error: The requested action could not be completed because the object no longer exists. at PDFComment.invokeGetter (<anonymous>:6:32)
Below is the code snippet which I had used for fetching comments and screenshot of PDFComment object with exception..
const { entrypoints, storage } = require("uxp");
const { app } = require("indesign");
if (app.documents.length > 0) {
const doc = app.activeDocument;
if (doc.pdfComments.length > 0) {
for (let i = 0; i < doc.pdfComments.length; i++) {
const comment = doc.pdfComments.item(i);
console.log(comment);
}
}
}

