Save custom zoom levels  SOLVED

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
Justus_T
User
Posts: 4
Joined: Sun Feb 12, 2017 7:31 pm

Save custom zoom levels

Post by Justus_T »

Hey everyone,

I've been using PDF-XChange Editor and it's predecessor for several years now, therefore first of all: thanks!
However there is a small nuisance that keeps bothering me. Very often I find myself in need of a zoom level between the predefined values (e.g. between 150% and 200%). Of course I could simply type a suitable value in the toolbar every time, but that gets quite annoying after a while. I would prefer to be able to add some (global) custom zoom levels so that you can simply use the 'CTRL + scrolling wheel'-shortcut.
This thread leads me to believe that this already possible with some basic programming/scripting skills:
https://www.pdf-xchange.com/forum3 ... om#p103921
Unfortunately, I don't have any programming skills at all, so is there still a way to achieve this via the GUI or a configuration file?

Best regards and thanks in advance
Justus
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Save custom zoom levels

Post by Will - Tracker Supp »

Hi Justus,

Thanks for the post - You may be able to create custom toolbar buttons that do this, but that would likely be fairly inefficient as you'd have lots of buttons for lots of zoom levels. I'm also not 100% sure whether or not it's possible to do this, as you'd need to use JavaScript and I'm not hugely fluent in it.

The post that you have linked is an SDK (Software Development Kit) post and a lot more is possible with our SDK's than would otherwise be possible for End Users. The SDK's are entirely different products and I would not recommend that you attempt to use them without a good level of programming experience, as they're very complex.

Thanks,
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
Justus_T
User
Posts: 4
Joined: Sun Feb 12, 2017 7:31 pm

Re: Save custom zoom levels

Post by Justus_T »

Thanks for your reply! As a temporary workaround the custom buttons would be fine for me. Most of the time I need 2-3 specific zoom levels that are not in the default options. But that already sounds like too much work for such a small inconvenience ;-) I just wanted to know if there is some easy way to do this. If there isn't, that's no big deal!

Best regards and thanks again!
Justus
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Save custom zoom levels

Post by Tracker Supp-Stefan »

Hello Justus,

As a workaround can you try the "Zoom to" pop-up window (default shortcut for it: Ctrl-Shift-M) - it will show a small pop-up in which you can quickly type your desired custom zoom level, and then hit enter on the keyboard to change to that. You can call it again when you need to change to another zoom level.

Also Ctrl+MouseWheel will quickly change the zoom level (at some predefined values - so not good if you need an exact custom zoom level, but still good for quickly changing to a higher/lower zoom).

Do you need those zoom levels because the PPI on your screen is different than the default used for 100% zoom (usually 96)? In this case - you can change that default DPI via Edit -> Preferences -> Page Display). My monitor is with a PPI of ~111.57 - so setting the value to 111 gives me a page on my screen at 100% almost indistinguishable from holding the same size sheet of paper in front of the screen.

Regards,
Stefan
Justus_T
User
Posts: 4
Joined: Sun Feb 12, 2017 7:31 pm

Re: Save custom zoom levels

Post by Justus_T »

Hey Stefan,

thanks for your tips! In fact I was already using them a lot (especially the CTRL+Mousewheel-shortcut :wink:)

Indeed, my PPI slightly differs from the default 96 PPI (24" @ 1920x1080 -> 91 PPI) but that is not the cause of my problem. However, I might be able to use it as a workaround. I will have more time this evening and will let you know if it works.
In the meantime, maybe it would be helpful if I elaborate a bit more on my use case:
I read a lot of scientific papers which generally use rather small font sizes. With my current setup, I find the default 100% rather uncomfortable to read. Therefore I zoom in. Most of the time my sweet spot is roughly around 175%. The default 150% is still too small, 200% already too big. Of course, this alone would not be a problem. I could simply enable the 'save last used view' option, set my desired zoom level and be done with it.
However, I find myself constantly having to switch between different zoom levels (CTRL+Mousewheel): footnotes and literature references use even smaller font sizes, so I zoom in but graphs and tables are often easier to read at a lower zoom level. Whenever I switch back to the regular text parts I need to manually type in my desired zoom level of 175% again.
Therefore I was wondering: obviously there are already predefined zoom levels for the CTRL+Mousewheel shortcut. These values need to be stored somewhere (?, or are they calculated?), in a configuration file or something. Maybe it is possible to simply add my desired values to this file. But obviously things are a bit more complicated :wink:

Best regards and thanks again for your help! It is much appreciated!
Justus
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Save custom zoom levels  SOLVED

Post by Will - Tracker Supp »

Hi Justus,

Thanks for the explanation - I completely understand. One of the things that has typically put me off of reading scientific publications is exactly that; it hurts my eyes trying to read it!

I took a look at what it would take to create the button and it was fairly simple, so I've attached a ZIP folder containing the the script. Extract the contents of the ZIP folder directly to C:\Program Files\Tracker Software\PDF Editor and make sure that the Editor is closed. When you restart it, the button will be there.

For others interested, the full script is:

Code: Select all

function zoom175()
{
	this.zoom = 175;
}

app.addToolButton({
    cName: "Zoom 175%",
    cExec: "zoom175()",
    cTooltext: "Zoom to 175%",
    cEnable: true,
    nPos: 0
});
You can easily create multiple toolbar buttons for different zoom levels by changing all instances of 175 to e.g. 125 or 158.64, etc. and creating multiple scripts (with zoom level appropriate names) to be saved in the JavaScripts folder.

Ordinarily, there will not be a JavaScripts folder under C:\Program Files\Tracker Software\PDF Editor\JavaScripts and it will need to be created manually (case sensitive), but my ZIP file contains the JavaScripts folder, which contains the script, so can be extracted directly to the Editor's folder.

HTH!
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
Justus_T
User
Posts: 4
Joined: Sun Feb 12, 2017 7:31 pm

Re: Save custom zoom levels

Post by Justus_T »

Hi Will, hi Stefan,

THANKS! It works! :D You just made my life way more comfortable! :wink:

Best regards
Justus
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Save custom zoom levels

Post by Tracker Supp-Stefan »

:)
jamrov
User
Posts: 13
Joined: Sat Oct 06, 2018 9:17 am

Re: Save custom zoom levels

Post by jamrov »

H:\pdf\PDF-XChangeEditorPortable_7.0.327\

1. Where I need to create JavaScripts folder
2. What is the .js file name ?
3. After reopen pdf I get Add-on Tools beside of help menu ?
Will - Tracker Supp wrote:Hi Justus,

Thanks for the explanation - I completely understand. One of the things that has typically put me off of reading scientific publications is exactly that; it hurts my eyes trying to read it!

I took a look at what it would take to create the button and it was fairly simple, so I've attached a ZIP folder containing the the script. Extract the contents of the ZIP folder directly to C:\Program Files\Tracker Software\PDF Editor and make sure that the Editor is closed. When you restart it, the button will be there.

For others interested, the full script is:

Code: Select all

function zoom175()
{
	this.zoom = 175;
}

app.addToolButton({
    cName: "Zoom 175%",
    cExec: "zoom175()",
    cTooltext: "Zoom to 175%",
    cEnable: true,
    nPos: 0
});
You can easily create multiple toolbar buttons for different zoom levels by changing all instances of 175 to e.g. 125 or 158.64, etc. and creating multiple scripts (with zoom level appropriate names) to be saved in the JavaScripts folder.

Ordinarily, there will not be a JavaScripts folder under C:\Program Files\Tracker Software\PDF Editor\JavaScripts and it will need to be created manually (case sensitive), but my ZIP file contains the JavaScripts folder, which contains the script, so can be extracted directly to the Editor's folder.

HTH!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Save custom zoom levels

Post by Tracker Supp-Stefan »

Hello Jamrov,

You need to go to
%AppData%\Tracker Software\PDFXEditor\3.0
and check if there is a JavaScripts folder in there.
If it does not exist - create it, and you can then put your custom scripts in there.

In the attached file is a Script which you can place in that folder to try it out. It will print all opened documents.
The second file is an Icon that should be placed in the same folder - and this icon will be used for the button. It is not a proper icon file - as there is no transparency, and if your editor is not with the default colours for the UI - it might look a bit strange.

Yes the Add-on Tools will appear in the ribbon on the right hand side of Help:
Add-on_Tools.png
Add-on_Tools.png (5.37 KiB) Viewed 3093 times
Regards,
Stefan
Attachments
PrintAll.zip
(1.51 KiB) Downloaded 150 times
jamrov
User
Posts: 13
Joined: Sat Oct 06, 2018 9:17 am

Re: Save custom zoom levels

Post by jamrov »

You need to go to
%AppData%\Tracker Software\PDFXEditor\3.0
and check if there is a JavaScripts folder in there.
If it does not exist - create it, and you can then put your custom scripts in there.

Code: Select all

function zoom175()
{
   this.zoom = 175;
}

app.addToolButton({
    cName: "Zoom 175%",
    cExec: "zoom175()",
    cTooltext: "Zoom to 175%",
    cEnable: true,
    nPos: 0
});
1. What is my custom script name for following code ? I can give any name ?

2. C:\Users\abc\AppData\Roaming\Tracker Software\PDFXEditor\3.0\JavaScripts
I extract all file from PrintAll.zip, then put print_all_48x48.png and printAllOpenedDocs.js to JavaScripts folder and close pdf exchange editor and open it but did not find Add-on tools right side of help menu
Tracker Supp-Stefan wrote:Hello Jamrov,

You need to go to
%AppData%\Tracker Software\PDFXEditor\3.0
and check if there is a JavaScripts folder in there.
If it does not exist - create it, and you can then put your custom scripts in there.

In the attached file is a Script which you can place in that folder to try it out. It will print all opened documents.
The second file is an Icon that should be placed in the same folder - and this icon will be used for the button. It is not a proper icon file - as there is no transparency, and if your editor is not with the default colours for the UI - it might look a bit strange.

Yes the Add-on Tools will appear in the ribbon on the right hand side of Help:
Add-on_Tools.png

Regards,
Stefan
Post Reply