Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to get Annotation reply comments?

New Here ,
May 11, 2016 May 11, 2016

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

TOPICS
Acrobat SDK and JavaScript , Windows
913
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2016 May 12, 2016

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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2020 Aug 01, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 02, 2020 Aug 02, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 02, 2020 Aug 02, 2020
LATEST

Thank you - will give it a shot !

 

Nick

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines