Clear highlighted text or detect if already highlighted

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

AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Clear highlighted text or detect if already highlighted

Post by AndreaCCS »

I need to be able programatically clear the highlighted text. It could also be useful to know if the characters are highlighted (e.g characters 2 - 10 on page 6 of a doc). The reason I need this is I am programatically highlighting some characters when they click on the text I retrieve from the database, if they had already clicked the same text before the highlight gets darker and darker until it is black!

I am using this code to highlight the characters
object DataOut = 0;
object[] vArr = new object[3];
vArr[0] = 1;
vArr[1] = 10;
vArr[2] = 32768; //Green
object DataIn = vArr;

axCoPDFXCview1.DoVerb("Documents[0].Pages[0].Text", "Highlight", DataIn, out DataOut, 0);
Andrea
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Clear highlighted text or detect if already highlighted

Post by Vasyl - PDF-XChange »

Hi, AndreaCCS.

In your case you may:

1. use new feature for create annotation with unique ID(name):
object DataOut = 0;
object[] vArr = new object[5];
vArr[0] = 1;
vArr[1] = 10;
vArr[2] = 32768; //Green
vArr[3] = 1.0; //opacity
vArr[4] = "NewAnnotID";
object DataIn = vArr;
...
axCoPDFXCview1.DoVerb("Documents[0].Pages[0].Text", "Highlight", DataIn, out DataOut, 0);
- this feature will be added into the new build (53, upcoming).

2. use java-script for deleting of the added annotation:
string script = "var a = this.getAnnot(0, "NewAnnotID"); if (a != null) { a.destroy(); };";
axCoPDFXCview1.RunJavaScript(script, null, -1, 0);

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.
AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Re: Clear highlighted text or detect if already highlighted

Post by AndreaCCS »

When is version 53 being released?
Andrea
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Clear highlighted text or detect if already highlighted

Post by Vasyl - PDF-XChange »

Build 53 is already released.
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.
AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Re: Clear highlighted text or detect if already highlighted

Post by AndreaCCS »

Yes have downloaded and installed - the confusion is the build version on the product page says the version is 2.052!
Andrea
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Clear highlighted text or detect if already highlighted

Post by Stefan - PDF-XChange »

The build numbers are now updated - apologies for the confusion.

Regards,
Stefan