Activating an annotation

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

relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Activating an annotation

Post by relapse »

Hi! My question is: Could I activate an annotation without clicking on it, simulating a click event? The background is: I have a toggle button which creates/deletes a selection area on loaded pdf document. The PDFViewer is a user control on my form. I'd like to have that selection area marked up (it's an annotation in form of a rectangle) directly after creating it without clicking on it. It means I have to commit the focus to the user control and then to adjust the appropriate properties of that annotation. Please take a look at it, if you haven't understood what I meant (see my attachment).

Thanks for your replies!
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Activating an annotation

Post by Stefan - PDF-XChange »

Hi Relapse,

You need the SelectAnnot method from section 2.2.2.4.1.1 of the Viewer manual I believe.

Best,
Stefan
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Re: Activating an annotation

Post by relapse »

Thanks a lot, it functions!

Code: Select all

object dataOut;
object objectName = null;
pdfViewer.DoDocumentVerb(docId, objectName, "SelectAnnot", "NameOfAnnotation", out dataOut);
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Activating an annotation

Post by Stefan - PDF-XChange »

:)