Shortcut to go at the beggining of the 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
raffam
User
Posts: 5
Joined: Mon Jun 12, 2017 11:33 am

Shortcut to go at the beggining of the page

Post 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
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17810
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Shortcut to go at the beggining of the page

Post 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
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Shortcut to go at the beggining of the page

Post 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.
Attachments
GoToTopOfPage.zip
(277 Bytes) Downloaded 103 times
raffam
User
Posts: 5
Joined: Mon Jun 12, 2017 11:33 am

Re: Shortcut to go at the beggining of the page

Post 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!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17810
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Shortcut to go at the beggining of the page

Post 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
raffam
User
Posts: 5
Joined: Mon Jun 12, 2017 11:33 am

Re: Shortcut to go at the beggining of the page

Post by raffam »

As I understand that solutions require 3 keystrokes, while willy solution only a mouse click :)
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Shortcut to go at the beggining of the page

Post 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.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17810
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Shortcut to go at the beggining of the page

Post 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
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Shortcut to go at the beginning of the page

Post 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.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17810
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Shortcut to go at the beggining of the page

Post 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
raffam
User
Posts: 5
Joined: Mon Jun 12, 2017 11:33 am

Re: Shortcut to go at the beggining of the page

Post 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
});
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17810
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Shortcut to go at the beggining of the page

Post 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
raffam
User
Posts: 5
Joined: Mon Jun 12, 2017 11:33 am

Re: Shortcut to go at the beggining of the page

Post 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 :)
Willy Van Nuffel
User
Posts: 2347
Joined: Wed Jan 18, 2006 12:10 pm

Re: Shortcut to go at the beggining of the page

Post by Willy Van Nuffel »

Thanks for sharing, and I agree with the remark.

:-)
User avatar
Bhikkhu Pesala
User
Posts: 1776
Joined: Tue May 29, 2007 9:29 am
Location: East London
Contact:

Re: Shortcut to go at the beggining of the page

Post by Bhikkhu Pesala »

Try GoTo Page.

In my case it's Ctrl Shift N, Enter
Windows 10 Home 64-bit • AMD Ryzen 5 3400G, 8 Gb
Review: http://www.softerviews.org/PDF-XChange.html
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Shortcut to go at the beggining of the page

Post by Will - Tracker Supp »

Thanks Bhikkhu :)
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

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply