Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

Hello!

Sometimes when I place a GoTo Link in a text (to go to another page in the document) I would like to, after the GoTo Link action happens, have pointed out a specific text in the page I went to.

I'd like to do that because sometimes the page that the "GoTo Link" goes has a lot of information in it that doesn't concern the reason why I make the GoTo link in the first place.

So I'd like to have the information that concerns the GoTo Link "pointed out" immediately as I arrive in the page so that I don't have to "keep looking" in the page to find that information. I know I could configure the zoom of the page to show only the information in the page that I want but that's not good for me because I work with my documents in a specific zoom configuration and I'd have to always keep changing the zoom back to my default configuration after I click in the GoTo Link.

So I think it would be really nice to have some sort of point out function to a specific text in the page I arrive after the "GoTo Link" action happens. I think that a "point out function" could be as simple as just a selection (the same way we do with our mouse) of the text that I want to point out . Is possible for that selection to happen automatically as I arrive in the page that the "go to link" function sends me to?

After we make a GoTo Link if we go into properties>actions and click in the "..." we see a "Edit Action List". In that list we see the action that the GoTo Link option made already and we have the option to add more actions.

I was think if it was possible to add a JavaScript, after the GoTo Link action, that would auto select the text that I want after I go to the new page in the document.
Sem título.png
I don't know how to use JavaScript so I dont know if this is possible. Could you help with that, please?

If its not possible to do this with JavaScript is it possible to do this (or something similar) with another action or with another functionality in the pdf x-change?

I'd be really grateful if someone could help me with this!

Thank you for the attention!
Igor
PDF-XChange Editor fan :)
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

An example so that I can be more clear
Sem título.png
Igor
PDF-XChange Editor fan :)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by Tracker Supp-Stefan »

Hello igorlima,

Looking at the JS API documentation for PDF files - there seems to be an "selectPageNthWord();" method, but this does not seem to be currently implemented in the Editor. I will check with our devs whether this can be added in a future build.

Kind regards,
Stefan
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

Tracker Supp-Stefan wrote: Thu Jan 13, 2022 3:19 pm Hello igorlima,

Looking at the JS API documentation for PDF files - there seems to be an "selectPageNthWord();" method, but this does not seem to be currently implemented in the Editor. I will check with our devs whether this can be added in a future build.

Kind regards,
Stefan
Hello, Stefan! Thank you for the response. I'm glad to see there could be a method where this could work. Hope the devs can give is good news about implementing this! I'll be waiting for your return! Thank you very much!
Igor
PDF-XChange Editor fan :)
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

I was thinking that maybe a auto find function could work too. For example, after I got to the page the, X-change could automatically perform a find on the page for a pre determined term I set on. Although I'd have to always close the find box after localizing the section of the page that I want, I think that it would not be such a hassle.

I found that
search.query("", "ActiveDoc")
works. But with that I get a the advanced search pane and not the small Find "box". Is there a way so that I can perform, with this, the find function and not the search function?

Thank you for the attention!
Igor
PDF-XChange Editor fan :)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by Tracker Supp-Stefan »

Hello igorlima,

Good news! Our devs confirmed that the selectPageNthWord() would be implemented in the next build.

I do not think it's possible to achieve your goal with the Find tool.


Kind regards,
Stefan
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

Tracker Supp-Stefan wrote: Fri Jan 14, 2022 9:46 am Hello igorlima,

Good news! Our devs confirmed that the selectPageNthWord() would be implemented in the next build.

I do not think it's possible to achieve your goal with the Find tool.


Kind regards,
Stefan
Hello, Stefan! That's great! Thank you very much!
Igor
PDF-XChange Editor fan :)
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

Hi, all!

Please, I'd like to know if the java script "selectPageNthWord();" was added in v 9.3.360, as it was said it would in this topic.

I tried using it but didn't work for me. Don't know if its because it wasn't added or because I don't how to use it :lol:

Thank you for the support!
Igor
PDF-XChange Editor fan :)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by Tracker Supp-Stefan »

Hello igorlima,

It certainly does work for me:
image.png
Please make sure you have updates properly, and note that this will place a 'temporary' highlight, and will not place a highlight annotation on the page.

Kind regards,
Stefan
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

Tracker Supp-Stefan wrote: Wed Apr 06, 2022 11:08 am Hello igorlima,

It certainly does work for me:
image.png
Please make sure you have updates properly, and note that this will place a 'temporary' highlight, and will not place a highlight annotation on the page.

Kind regards,
Stefan
Hi, Stefan

Thank you for the response!

After trying again, I got to work on my end too. Sorry about that and thank you for the implementation!

I just have one question regarding using this script: Is it possible to know the number of a specific word in a page without having to count one by one?

If not, could you tell me, please, if there is another script that I can use to temporary highlight a specific word in a page or a specific place (using coordinates X and Y, or something else).

thank you for the support!
Igor
PDF-XChange Editor fan :)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by Tracker Supp-Stefan »

Hello igorlima,

No - you will have to enumerate through the words on the page to get their respective number in the order of words on that page, before you can highlight them in this way.

Kind regards,
Stefan
igorlima
User
Posts: 174
Joined: Sat Aug 22, 2020 12:16 pm

Re: Is it possible to go to a page (through a GoTo Link) then have a text automatically selected in that page?

Post by igorlima »

Tracker Supp-Stefan wrote: Wed Apr 06, 2022 1:38 pm Hello igorlima,

No - you will have to enumerate through the words on the page to get their respective number in the order of words on that page, before you can highlight them in this way.

Kind regards,
Stefan
I see. Thank you, Stefan.
Igor
PDF-XChange Editor fan :)
Post Reply