Reply Note Attributes?

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

DanielG
User
Posts: 34
Joined: Wed Oct 09, 2013 5:58 pm

Reply Note Attributes?

Post by DanielG »

A number of annotations (Highlight, Text, Circle, Square, etc.) allow you to add a note and a reply note. Using JavaScript, I am able to get the attributes for a note: annot.richContents

However, I don't seem to be able to find any way to access the reply note attributes via JavaScript. Am I missing something?
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: Reply Note Attributes?

Post by Ivan - Tracker Software »

Unfortunately in JS for PDF there are no simple function to get all replies to the the annotation, but it easily can be done using own function, like that:

Code: Select all

function getAllReplies(annot)
{
  var replies = [];
  var annots = this.getAnnots(annot.page);
  var cnt = 0;
  for (var i = 0; i < annots.length; i++)
  {
    if (annots[i].type == "Text" && annots[i].inReplyTo == annot.name)
      replies[cnt++] = annots[i];
  }
  return replies;
}

// using example
var a = getAnnots(0)[0];
var replies = getAllReplies(a);
it gets an array of immediate replies to the annotation; to get a tree of all replies, you have to call it recursively for each annotations in returned array for each level.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
DanielG
User
Posts: 34
Joined: Wed Oct 09, 2013 5:58 pm

Re: Reply Note Attributes?

Post by DanielG »

Thank you - that was very helpful.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Reply Note Attributes?

Post by Will - Tracker Supp »

:)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com