With the Document command "GetSelectedAnnot", you are given a page number and index of the "active"/"selected" annotation. -1 is returned if no annotations are currently active/selected. This is great.
I assumed, and I believe poorly, that I could use that index returned from GetSelectedAnnot within Javascript to find the annotation in question. I would get the collection of annotations using getAnnots() and then simply index right into it to find my target annotation. The problem with this approach is that GetSelectedAnnot takes into account Popup Note windows whereas getAnnots does not (another assumption on my part).
How to poorly assume a correlation:
1) Place three Note annotations on a new document with their popups open.
2) Select the third note annotation icon.
3) Execute the document command for GetSelectedAnnot.
4) Pull your data out of the returned safearray/etc. Your annotation index should be 4.
--- 0 is the first note icon, 1 is the first note popup window, 2 is the ...
5) In javascript execute "this.getAnnots().length". Should be a length of 3.
So, how can I actually use the index returned form GetSelectedAnnot?
GetSelectedAnnot not syncing with getAnnots()
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 216
- Joined: Thu Jul 08, 2004 7:29 pm
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: GetSelectedAnnot not syncing with getAnnots()
Hi, DSSavant.
No way for this currently. But we will add new feature to solve this problem.
ctrl.SetDocumentProperty(docId, "GetSelMarkupsOnly", "true", 0);
and ctrl.GetSelectedAnnot will work like to js.this.getAnnots() on the page...
Wait for the next build...
Best
regards
No way for this currently. But we will add new feature to solve this problem.
ctrl.SetDocumentProperty(docId, "GetSelMarkupsOnly", "true", 0);
and ctrl.GetSelectedAnnot will work like to js.this.getAnnots() on the page...
Wait for the next build...
Best
regards
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.