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?
Reply Note Attributes?
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 3586
- Joined: Thu Jul 08, 2004 10:36 pm
Re: Reply Note Attributes?
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:
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.
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);
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.
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.
-
- User
- Posts: 34
- Joined: Wed Oct 09, 2013 5:58 pm
Re: Reply Note Attributes?
Thank you - that was very helpful.
-
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
Re: Reply Note Attributes?

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
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com