Page 1 of 1

Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 11:36 am
by raffam
Hi all,
is there any keyboard shortcut to go at the beginning of the page?
I am reading several articles where each page is split in 2 columns.
would be nice to go to the beginning of the page after I have finished reading the left column

Re: Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 12:14 pm
by Tracker Supp-Stefan
Hello raffam,

Welcome to our forums!
I've just checked - but there does not seem to be such a shortcut.
As an alternative - hitting down the space bar will switch your tool to the hand one while the space is down - so that you can quickly navigate through the page(s) - without changing the active tool.

Regards,
Stefan

Re: Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 1:20 pm
by Willy Van Nuffel
Alternatives ?

1) Go to previous page / Go to next page
CTRL + LEFT CURSOR / CTRL + RIGHT CURSOR
(requires two key presses)

2) Same action in a JavaScript
this.pageNum--;
this.pageNum++;
made available in form of a button on top of the page panel, by putting the attached *.js file in
C:\Program Files\Tracker Software\PDF Editor\JavaScripts
(requires one mouse click)

3) Via the thumbnails pane, clicking the top of the concerning page
(requires one mouse click)

Best regards.

Re: Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 1:49 pm
by raffam
Wow, thanks guys!

@Willy Van Nuffel

I used the first alternative, but I like the javascript wich works correctly as you explained!

Is there no possibility to set a keyboard shortcut for that javascript? I skimmed in the menus but it seems there isn't any possibility to customize the keyboard shortcuts at all.

Thanks!

Re: Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 1:54 pm
by Tracker Supp-Stefan
Hi Willy,

Why use a JS when there are already commands and buttons for those operations:
Untitled.png
You can just re-assign a different shortcut for those if Ctrl-Right and Ctrl-Left two key combinations are not desired :)

Regards,
Stefan

Re: Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 2:03 pm
by raffam
As I understand that solutions require 3 keystrokes, while willy solution only a mouse click :)

Re: Shortcut to go at the beggining of the page

Posted: Mon Jun 12, 2017 3:23 pm
by Willy Van Nuffel
Stefan, my goal for using JavaScript is to combine two (or more) actions into one.

Currently, it does not seem to be possible to assign a keyboard shortcut to a tool-button that has been added via JavaScript.
:-(

For me, the most easy way to go to the top of the page is using:
- the Thumbnails pane (requires just one mouse click)
- CTRL + LEFT followed by CTRL + RIGHT (or vice-versa works too) (requires two keystrokes)
The second method does not work in case of a PDF with only one page.

QUESTION for Tracker Software Development:
Would it be possible to add a function for going to the top (or the end) of a page, so that people can assign a shortcut to this?

Best regards.

Re: Shortcut to go at the beggining of the page

Posted: Tue Jun 13, 2017 11:53 am
by Tracker Supp-Stefan
Hi Willy,

Yes - certainly - if you need more than one action assigned to a single button - custom JS buttons are the way to go.
And shortcuts can't be assigned to them as those are dynamically loaded from an external file that can be here this launch of the Editor and gone the next one.

Regards,
Stefan

Re: Shortcut to go at the beginning of the page

Posted: Tue Jun 13, 2017 4:52 pm
by Willy Van Nuffel
1) Thanks for your answer Stefan. It's a pitty that there is no option to assign a shortcut (key combination) to app.addToolButton in JavaScript.

2) No answer on my request for a "Goto Top / Goto Bottom in the current page" feature?

Best regards.

Re: Shortcut to go at the beggining of the page

Posted: Tue Jun 13, 2017 5:15 pm
by Tracker Supp-Stefan
Hi All,

Yes - it's a shame for the shortcuts - but there have to be some limits to what can be done with a PDF file even for the JS engine ;)

And sorry for not commenting on the second issue - but I just don't have any news on that one. I will mention it to our devs and have them consider it, but please note this is not a promise that we could implement such a feature, as it might well get rejected.

Regards,
Stefan

Re: Shortcut to go at the beggining of the page

Posted: Fri Jun 16, 2017 4:40 pm
by raffam
I have fixed the script to work also on the very first page of a document. Before it didn't work on the first page, since that page has no previous page

Here is the new script

Code: Select all

function TopOfPage()
{
	if(this.pageNum==0)
	{
		this.pageNum++;
		this.pageNum--;
	}
	else
	{
		this.pageNum--;
		this.pageNum++;
	}
}

app.addToolButton({
    cName: "TopOfPage",
    cExec: "TopOfPage()",
    cTooltext: "Go to the top of the page",
    cEnable: true,
    nPos: 0
});

Re: Shortcut to go at the beggining of the page

Posted: Fri Jun 16, 2017 4:48 pm
by Tracker Supp-Stefan
Hello raffam,

Glad to hear you sorted it out! And thanks for sharing it!
I am sure it will be useful to someone else too!

Regards,
Stefan

Re: Shortcut to go at the beggining of the page

Posted: Fri Jun 16, 2017 4:57 pm
by raffam
Pleasure,

by the way I still don't get this point
nd shortcuts can't be assigned to them as those are dynamically loaded from an external file that can be here this launch of the Editor and gone the next one.
If you allow shortcut assignment through javascript, for example in the addToolButton() function, if the script goes away, the code that assign the shortcuts is gone with it. I don't understand the problem :)

Re: Shortcut to go at the beggining of the page

Posted: Fri Jun 16, 2017 5:03 pm
by Willy Van Nuffel
Thanks for sharing, and I agree with the remark.

:-)

Re: Shortcut to go at the beggining of the page

Posted: Sat Jun 17, 2017 3:03 pm
by Bhikkhu Pesala
Try GoTo Page.

In my case it's Ctrl Shift N, Enter

Re: Shortcut to go at the beggining of the page

Posted: Sat Jun 17, 2017 8:20 pm
by Will - Tracker Supp
Thanks Bhikkhu :)