Bug: GetSelectedRanges after Select

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

jykim
User
Posts: 37
Joined: Fri Oct 02, 2009 12:30 am

Bug: GetSelectedRanges after Select

Post by jykim »

Hi,

I have the following code to get selected ranges -

Code: Select all

Call CoPDFXCview1.DoDocumentVerb(0, "Pages", "GetSelectedRanges", vDataIn, vDataOut)
iFirstPage = Int(vDataOut(0))
This works well if I "select" some text through UI, but if I "select" some text programatically, like this -

Code: Select all

Call CoPDFXCview1.DoVerb("Documents[0].Pages[8].Text", "Select", vDataIn, vDataOut)
, and then call "GetSelectedRanges", the "vDataOut" variant is "empty".
Please let me know if you need more information to reproduce this problem.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Bug: GetSelectedRanges after Select

Post by Corwin - Tracker Sup »

Hi,

When you want to get selected ranges, you should also specify on which page you want to get selection. So your code should be

Code: Select all

Call CoPDFXCview1.DoDocumentVerb(0, "Pages[0].Text", "GetSelectedRanges", vDataIn, vDataOut)
- this will take selected range from first page.

HTH
jykim
User
Posts: 37
Joined: Fri Oct 02, 2009 12:30 am

Re: Bug: GetSelectedRanges after Select

Post by jykim »

Hi Corwin,

Based on Vasyl's comments in this thread http://www.docu-track.com/forum3/postin ... 36&p=31744, it it possible to use "GetSelectedRanges" without specifying the page.
Vasyl-Tracker Dev Team wrote:Hi,
Additionally, new method will be added for obtain pages with selection, such as:

Code: Select all

DoDocumentVerb(docID, "Pages", "GetSelectedRanges", dataIn, dataOut, 0);
// we can obtain one(usually), two(and more) page-ranges(s):
int firstPageWithSel1 = dataOut[0];
int countPagesWithSel1 = dataOut[1];
int firstPageWithSel2 = dataOut[2];
int countPagesWithSel2 = dataOut[3];
...
Best
Regards
And, I have to use this so that I can get the page index, and then use "GetSelectedRanges" again with the page index to get the selection offset and length.

Like I said, it works when the selection is made by UI, but it doesn't work when the selection is made by programatically. That's why I thought there is a bug.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Bug: GetSelectedRanges after Select

Post by Corwin - Tracker Sup »

Ok, thanks for the report. This will be fixed in new build.
jykim
User
Posts: 37
Joined: Fri Oct 02, 2009 12:30 am

Re: Bug: GetSelectedRanges after Select

Post by jykim »

Sounds good. Thanks!
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Bug: GetSelectedRanges after Select

Post by John - Tracker Supp »

:)
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
Tracker Support
http://www.tracker-software.com