Get the coordinates of selected text to create 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

bmw
User
Posts: 14
Joined: Wed Dec 11, 2013 11:47 pm

Get the coordinates of selected text to create annotation

Post by bmw »

I searched the forum and found that "For now Viewer AX doesn't support such events as click on annotation. And you cannot get the coordinates of selected text" in 2009.

Is it apply the PDF-XChange Viewer SDK Current Version:2.5.213.1?
Is it possible changing the default color in code?

My goal is
1)User opens a pdf doc
2)User selects text in the document
3)User create an annotation on this document by default color.

If the PDF-XChange Viewer SDK has these function, would you provide an example and link to me for achieving my goal.

By the way, if the PDF-XChange Viewer SDK doesn't has these function, which product has the above function?


Thanks in advance.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Get the coordinates of selected text to create annotatio

Post by Stefan - PDF-XChange »

Hello bmw,

If it is the User that needs to do all 3 operations - they can certainly do that. All you need to do is load the AX control inside your application, and then let them open the documents, make the selection (pick up the "text selection" tool), and then give them access to the annotation creation tools for them to add the annotations.

However if you want to you can open a document via code, and can also get information for various selections the user has made, and create annotations (via JS code). Please take a look at the AX SDK manual for samples on how to achieve all these things.

Regards,
Stefan
bmw
User
Posts: 14
Joined: Wed Dec 11, 2013 11:47 pm

Re: Get the coordinates of selected text to create annotatio

Post by bmw »

Hi,

I read the SDK manual, but I have no clue to do it. I tested some method such as getPageNthWord, getpageNthWordQuads on JavaScript example code. These methods require the number of text and page index. Which method is used to get the information for the word and quads the user has made.
I am appreciated if you provide some hint and code example to solve my problem.

By the way , can I create my own javascript function in text as a parameter by running IPDFXCview.RunJavaScript() method?


Thanks in advance
bmw
User
Posts: 14
Joined: Wed Dec 11, 2013 11:47 pm

Re: Get the coordinates of selected text to create annotatio

Post by bmw »

Hi Stefan,

I found the method to achieve my goal by setting the default style color and applying the highlight annotation. thanks.
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7361
Joined: Wed Mar 25, 2009 10:37 pm

Re: Get the coordinates of selected text to create annotatio

Post by Paul - PDF-XChange »

:)
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com