Changing page without moving view
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 11
- Joined: Mon Nov 04, 2019 5:53 pm
Changing page without moving view
Is it possible to be zoomed into a page and then switch to the next page but maintain the location I was zoomed to?
For example, say I'm zoomed into the bottom right corner of page 3 to check page numbers, when I use the next page button (or Ctrl+Right), I'd like to stay zoomed into the bottom right corner on the next page, page 4. However, currently, I automatically get reverted to the top right corner of the next page, page 4. Now I need to manually pan to where I was on page 3.
It seems to me that Ctrl+Up does the same as Ctrl+Left and Ctrl+Down does the same as Ctrl+Right, it'd be nice if Ctrl+Right switched pages but maintained your zoom location.
A workaround I've used: Use Loupe tool. Not a great workaround since it takes up more screen real estate and requires additional clicking and setting up. If I now want to make a markup, I have to exit Loupe mode, then make the markup, then set Loupe back up to continue.
As a side note, other software (bb) offers this capability and it is a slight advantage over PDF X-change, though PDFX is better in most other ways.
For example, say I'm zoomed into the bottom right corner of page 3 to check page numbers, when I use the next page button (or Ctrl+Right), I'd like to stay zoomed into the bottom right corner on the next page, page 4. However, currently, I automatically get reverted to the top right corner of the next page, page 4. Now I need to manually pan to where I was on page 3.
It seems to me that Ctrl+Up does the same as Ctrl+Left and Ctrl+Down does the same as Ctrl+Right, it'd be nice if Ctrl+Right switched pages but maintained your zoom location.
A workaround I've used: Use Loupe tool. Not a great workaround since it takes up more screen real estate and requires additional clicking and setting up. If I now want to make a markup, I have to exit Loupe mode, then make the markup, then set Loupe back up to continue.
As a side note, other software (bb) offers this capability and it is a slight advantage over PDF X-change, though PDFX is better in most other ways.
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Changing page without moving view
Hello, Heezea
At the moment I do not believe we have any functions that would allow for this handling, but I have brought it up with the dev team and they are looking into the possibility now. It may be something that we can offer in the future, but for now, I am afraid that I do not have a better solution for you than the loupe tool.
Kind regards,
At the moment I do not believe we have any functions that would allow for this handling, but I have brought it up with the dev team and they are looking into the possibility now. It may be something that we can offer in the future, but for now, I am afraid that I do not have a better solution for you than the loupe tool.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 11
- Joined: Mon Nov 04, 2019 5:53 pm
Re: Changing page without moving view
Daniel, thanks for your reply. That's encouraging. It's pretty cool when software developers help and listen to their users! All the best.
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Changing page without moving view

Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 1638
- Joined: Thu Feb 28, 2008 8:16 pm
Re: Changing page without moving view
Hi all,
I agree that this would be a useful feature.
What I do is, I create a link on each of the pages I want to go back and forth between, roughly in the area of interest, that points to the respective other (or next) page.
If everything is set to "Inherit" in the link properties, then it is possible to switch between pages without changing zoom level or scroll position, by clicking on the respective link.
Hth & cheers
David
I agree that this would be a useful feature.
What I do is, I create a link on each of the pages I want to go back and forth between, roughly in the area of interest, that points to the respective other (or next) page.
If everything is set to "Inherit" in the link properties, then it is possible to switch between pages without changing zoom level or scroll position, by clicking on the respective link.
Hth & cheers
David
David.P
PDF-XChange Pro
PDF-XChange Pro
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Changing page without moving view
Hello, David.P
Another solution, while we are looking at this, is to enable the "forbit changes" option under page display: This way, when you click a bookmark, it will only go to the target page number, and retain the current zoom level as well as position.
Kind regards,
Another solution, while we are looking at this, is to enable the "forbit changes" option under page display: This way, when you click a bookmark, it will only go to the target page number, and retain the current zoom level as well as position.
Kind regards,
You do not have the required permissions to view the files attached to this post.
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 584
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Changing page without moving view
Here's a workaround - I need this all the time when working with big drawings:
This script will add two buttons to the Add-on toolbar to go forward and back without changing the zoom or page position. Copy and paste into a text file and save as
C:\Users\[YOUR USER NAME]\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Javascripts\NextPrev_page.js
I don't know how to do icons - someone smarter than me may be able to suggest that. In the mean time, it just has default puzzle pieces.
This script will add two buttons to the Add-on toolbar to go forward and back without changing the zoom or page position. Copy and paste into a text file and save as
C:\Users\[YOUR USER NAME]\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Javascripts\NextPrev_page.js
Code: Select all
// add two buttons to the add-in toolbar
app.addToolButton( {
cName: "PreviousSameView",
cLabel: "<",
cTooltext: "Go to previous page",
cEnable: 'event.rc = ( this.pageNum > 0 )',
cExec: '(function (t) {var vs = t.viewState;vs.pageViewRow --;vs.pageViewPageNum --;t.viewState = vs;})(this);'}
);
app.addToolButton( {
cName: "NextSameView",
cLabel: ">",
cTooltext: "Go to next page",
cEnable: 'event.rc = ( this.pageNum < this.numPages-1 )',
cExec: '(function (t) {var vs = t.viewState;vs.pageViewRow ++;vs.pageViewPageNum ++;t.viewState = vs;})(this);'}
);
Last edited by Mathew on Thu Mar 02, 2023 1:53 am, edited 2 times in total.
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Changing page without moving view

Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 584
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Changing page without moving view
OK, after a bit of fiddling around, I figured out how to add custom icons. This is the same script, but with custom icons. Save it to the JavaScripts folder as
C:\Users\[YOUR USER NAME]\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Javascripts\NextPrev_page.js
or you can just run it from the javascript window, but the buttons will go away next time you restart.
C:\Users\[YOUR USER NAME]\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Javascripts\NextPrev_page.js
Code: Select all
// add two buttons to the add-in toolbar
// this is hex encoded icon streams
var iconSet = { left:"FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF3F3F3FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF2F2F2FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FF474747FF454545FF454545FF454545FF454545FF454545FF454545FF313131FF242424FF0A0A0AFFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4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4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF2F2F2FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4FFF4F4F4",
iconStream:function(val){var data=this[val];
return {count:0, width:20, height:20, read:function(nBytes){return data.slice(this.count,this.count+=2*nBytes)}}}
};
app.addToolButton( {
cName: "PreviousSameView",
//cLabel: "<",
oIcon: iconSet.iconStream("left"),
cTooltext: "Go to previous page",
cEnable: 'event.rc = ( this.pageNum > 0 )',
cExec: '(function (t) {var vs = t.viewState;vs.pageViewRow --;vs.pageViewPageNum --;t.viewState = vs;})(this);'}
);
app.addToolButton( {
cName: "NextSameView",
//cLabel: ">",
oIcon: iconSet.iconStream("right"),
cTooltext: "Go to next page",
cEnable: 'event.rc = ( this.pageNum < this.numPages-1 )',
cExec: '(function (t) {var vs = t.viewState;vs.pageViewRow ++;vs.pageViewPageNum ++;t.viewState = vs;})(this);'}
);
-
- Site Admin
- Posts: 7362
- Joined: Wed Mar 25, 2009 10:37 pm
Changing page without moving view

Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 1
- Joined: Thu Apr 20, 2023 12:44 pm
Re: Changing page without moving view
Below is another javascript option that adds toolbar buttons. It has the following additional feature - if the Next Page button is selected when at the last page, it will jump to the first page. This can be useful when navigating a large set of drawings. This is my first javascript, so I'm sure there are optimizations to be found (see the earlier scripts in this thread). Also no custom icons. Hope it is useful to others.
Code: Select all
// ####################################################################
// PDF Javascript
// Description: Change the pdf page without changing the zoom or pan.
// Useful for looking through drawings where the zoom and
// and pan of the pages is not changed when the page
// number is changed.
// Author: Alan Moore
// Revision: 1.1
// Date: 11/04/2023
// Notes: Originally written for Tracker Software PDF-Xchange.
// Not tested on other pdf software packages.
// ####################################################################
// ----------------------------------------
// Funciton to change to the Previous Page
// ----------------------------------------
function pageChangePrevious()
{
var cViewState = this.viewState; // get the current viewState
var nViewState = cViewState; // create a new viewState variable
// Increment the current page number by -1
nViewState.pageViewRow = cViewState.pageViewRow - 1;
nViewState.pageViewPageNum = cViewState.pageViewPageNum - 1;
// Update the pdf viewState to the new viewState
this.viewState = nViewState;
}
// Previous Page - Add toolbar button
app.addToolButton({
cName: "Previous Page (zoom and pan unchanged)",
cLabel: "Previous Page View",
cExec: "pageChangePrevious()",
cTooltext: "Previous Page (zoom and pan unchanged)",
cEnable: true,
nPos: -1,
});
// ----------------------------------------
// Funciton to change to the Next Page
// ----------------------------------------
function pageChangeNext()
{
var cViewState = this.viewState; // get the current viewState
var nViewState = cViewState; // create a new viewState variable
// Add test to check if at the last page
var currentPage = this.pageNum;
var totalPages = this.numPages;
if (totalPages == currentPage + 1) {
nViewState.pageViewRow = 0; // Go to first page from last page
nViewState.pageViewPageNum = 0; // Go to first page from last page
} else {
// Increment the current page number by +1
nViewState.pageViewRow = cViewState.pageViewRow + 1;
nViewState.pageViewPageNum = cViewState.pageViewPageNum + 1;
}
// Update the pdf viewState to the new viewState
this.viewState = nViewState;
}
// Next Page - Add toolbar button
app.addToolButton({
cName: "Next Page (zoom and pan unchanged)",
cLabel: "Next Page View",
cExec: "pageChangeNext()",
cTooltext: "Next Page (zoom and pan unchanged)",
cEnable: true,
nPos: -1,
});
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Changing page without moving view
Hello, amoore
Thank you once again for the update, I hope that this helps someone else.
As for your mention of this not being tested in other software. I am not certain about the viability of adding buttons to our competitors toolbars, but the actual executed function should be fully compatible with any other PDF software that understands JavaScript.
Kind regards,
Thank you once again for the update, I hope that this helps someone else.
As for your mention of this not being tested in other software. I am not certain about the viability of adding buttons to our competitors toolbars, but the actual executed function should be fully compatible with any other PDF software that understands JavaScript.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 1638
- Joined: Thu Feb 28, 2008 8:16 pm
Re: Changing page without moving view
Severely missing the "Like" button here 
David.P
PDF-XChange Pro
PDF-XChange Pro
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Changing page without moving view
Hello, David.P
Haha, perhaps, but alas, at the moment we don't have that feature here on the forums.
Kind regards,
Haha, perhaps, but alas, at the moment we don't have that feature here on the forums.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 584
- Joined: Thu Jun 19, 2014 7:30 pm
Re: Changing page without moving view
I love that PDFxchange has such robust support for javascripting. It really is a great feature.
Now, if only we could paste our own script into the command properties to override the default command...
Now, if only we could paste our own script into the command properties to override the default command...
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Changing page without moving view
Hello, Mathew
Thank you for the suggestion, unfortunately due to the nature of how JS created buttons work (namely, they do not persist between sessions), the JS in the JS folder is actually re-run and recreates them on each successive launch, it will not be possible to assign custom command keybindings to these, beyond those that are auto-assigned on the "add-on tools" tab, with the alt commands (IE in this example gif, Alt+Y1+Y1 will run the first item on the list): Kind regards,
Thank you for the suggestion, unfortunately due to the nature of how JS created buttons work (namely, they do not persist between sessions), the JS in the JS folder is actually re-run and recreates them on each successive launch, it will not be possible to assign custom command keybindings to these, beyond those that are auto-assigned on the "add-on tools" tab, with the alt commands (IE in this example gif, Alt+Y1+Y1 will run the first item on the list): Kind regards,
You do not have the required permissions to view the files attached to this post.
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 1688
- Joined: Sat Sep 11, 2021 5:04 am
Re: Changing page without moving view
Hello all,
I have been reading this topic with great interest. Thank you for sharing your wonderful scripts with us.
I often use shortcut keys to run JavaScript from full screen mode. Of course, this is not possible in the normal way, so I set the Add-on Tools toolbar to floating mode on Classic UI. Shortcut keys are assigned using autohotkey. In full-screen mode, the Add-on Tools toolbar is hidden in the background, so the script first activates the hidden Add-on Tools toolbar in the front and then clicks on a specific button position on the Add-on Tools toolbar.
Best regards,
rakunavi
I have been reading this topic with great interest. Thank you for sharing your wonderful scripts with us.
I often use shortcut keys to run JavaScript from full screen mode. Of course, this is not possible in the normal way, so I set the Add-on Tools toolbar to floating mode on Classic UI. Shortcut keys are assigned using autohotkey. In full-screen mode, the Add-on Tools toolbar is hidden in the background, so the script first activates the hidden Add-on Tools toolbar in the front and then clicks on a specific button position on the Add-on Tools toolbar.
- Floating state and size of toolbars added by document-level JavaScript not restored in Classic toolbar
viewtopic.php?t=39536
Even if it is not possible to assign them to individual scripts for the reasons Daniel mentioned, it might be possible to improve the program to have a series of commands that specify "Nth from the left of the Add-on Tools". Just like Daniel does with "Alt+Y1+Y1" to execute "first from the left of the Add-on Tools" or what I do with autohotkey scripts.TrackerSupp-Daniel wrote: ↑Thu Apr 20, 2023 10:21 pm Thank you for the suggestion, unfortunately due to the nature of how JS created buttons work (namely, they do not persist between sessions), the JS in the JS folder is actually re-run and recreates them on each successive launch, it will not be possible to assign custom command keybindings to these, beyond those that are auto-assigned on the "add-on tools" tab, with the alt commands (IE in this example gif, Alt+Y1+Y1 will run the first item on the list):
- Command image
"1st from the left of the Add-on Tools" --- shortcut key assignment:: F13
"2nd from the left of the Add-on Tools" --- shortcut key assignment:: F14
"3rd from the left of the Add-on Tools" --- shortcut key assignment:: F15
...
Best regards,
rakunavi
You do not have the required permissions to view the files attached to this post.
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
-
- Site Admin
- Posts: 11094
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Changing page without moving view
Hello, rakunavi
Thank you, for the creative solution to the issue here. I hope it helps!
Kind regards,
Thank you, for the creative solution to the issue here. I hope it helps!
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com