Copy link to clipboard
Copied
Hi,
I used below code for read Annotation comment from the pdf document using acrobat pro 11 . But I need to read Annotation reply comments also. Any way to achieve this?.
var annots = this.getAnnots({
nPage:1,
nSortBy: ANSB_Author,
bReverse: true
});
console.show();
console.println("Number of Annotations: " + annots.length);
var msg = "%s in a %s annot said: \"%s\"";
for (var i = 0; i < annots.length; i++)
console.println(util.printf(msg, annots.author, annots.type,
annots.contents));
Thanks,
Kesavan R
Copy link to clipboard
Copied
This code should return all kinds of annotations, including replies. Is
that not the case?
On Thu, May 12, 2016 at 9:09 AM, kesavanraju7 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
I have a similar question to this one (which appears to not have been followed up on).
I have a need similar to that above - but am only able to retrieve the original contents, not any replys. I have not been able to find any posts related to retrieving that information. I was thinking that maybe contents was an array, but that does not seem to be the case. Any info or direction would be greatly appreciated.
Simple example:
var aAnnots = this.selectedAnnots;
for (var i=0; i < aAnnots.length; i++) {
console.println(aAnnots[i].contents);
}
Thanks,
Nick
Copy link to clipboard
Copied
You're not doing the same as the original poster did. You're accessing the selected annots array. They used the getAnnots method to retrieve the annotations. You can not select a reply, only a top-level comment, so doing it like that will not work. To access replies you must use getAnnots and then check the inReplyTo property of each annotation. If it's not empty then it will contain the name property of the comment to which it replied.
Copy link to clipboard
Copied
Thank you - will give it a shot !
Nick