Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Action > Open Options... How to set Magnification without changing Page Number?

Explorer ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

I need to change the "open options" of hundreds of PDFs. I figured I was going to create an action for that, but I hit a wall. I need to set the Magnification to "Fit Page" but I need to leave the Page Number unchanged because if I change it in order to have access to the Magnification field, I hit another wall... Most of the PDF documents I must change do not start with a physical page number of 1, but with some inconsistant logical page number (some PDFs start with C1, others with Cover, others with A, and even others with a blank logical page number!). By typing 1 in the Page Number field, I end up with documents opening on physical page 18 and the like.

 

Untitled.jpg

 

Can someone with more experience tell me how to solve this conundrum?

TOPICS
How to, Print and prepress

Views

466

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jun 06, 2020 Jun 06, 2020
Hmmm... Interesting. So if I follow you properly, when one sets the Initial View settings (File > Properties > Initial View) and selects for example "Bookmarks Panel and Page", "Two-Up (Cover Page)", "Fit Page" and the like, these are not flags in the PDF document but actions that get executed upon opening the document, in a similar way as document JavaScript gets executed when opening the document? This would explain why the Open Action is an all or nothing... Thank you for that... A bit counte...

Likes

Translate

Translate
Adobe Community Professional ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

You can do it using a script, then, instead of the built-in command.

Create an Action that executes the following JavaScript code on your files:

this.addScript("load", "this.zoomtype = zoomtype.fitP;");

 

Don't forget to add a Save command, of course.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

Thanks try67 for your suggestion. I did try that prior to posting my message, but the problem with this approach is that it only works when someone is opening the docuent in Acrobat and has JavaScript enabled. I would really want to modify the Open Options like I would normally do by going into File > Properties > Initial View... Except, as I need to do it in multiple documents, doing it by hand is not an option.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 22, 2021 May 22, 2021

Copy link to clipboard

Copied

Hello,

 

I just stumbled on this interesting thread.

 

May I ask whether it is possible to set the initial document view of a PDF via Document JavaScript -- instead of setting the "Initial View" options in the Document Properties.

 

I've tried adding:

pane = "B";

...which actually worked, however these:

zoomType = "zoomtype.fitP";
this.viewState = {pageViewLayoutMode:1};
app.execMenuItem("ShowHideFileAttachment");

...didn't seem to work.

 

Thanks for any hints whether there are ways do this via JavaScript.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 22, 2021 May 22, 2021

Copy link to clipboard

Copied

1. zoomtype.fitP is not a string, so remove the quotes from around it.

2. Not sure what this line is supposed to do.

3. This one worked just fine for me.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

Almost 24 hours has passed and no promising hint... Seriously, probably not the most sought feature, but how could have Adobe's engineers not realize the fact that one could want to change the magnification setting in a collection of PDF documents without actually changing the page unto which the document would open? I mean, this functionnality has remained largely unchanged since... as far as I can remember. Why is it an all or nothing option? Why can't we decide if we want to change the page number or not separately from the magnification? Moreover why are there no provision to specify if the page number is absolute (physical) or logical so that regardless how or whether the pages of a document are labeled, this action would not crash with an error message saying page so and so does not exist in this document? I am just trying to understand the logic behind this dialog... Am I seriously the only person facing this problem? Am I doing it wrongt? Is there a way that is little known to enter the page number so that the action will work?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

You don't quite understand how this works, I think. The "Open Options" are not individual settings. In each PDF file there's an "Open Action/Destination" that is executed when the file is opened. That destination can't just contain a zoom level, it has to also have a page (number) associated with it. The mistake the Acrobat developers did was to switch the interface from referencing logical page numbers (first page is always 1, second page is always 2, etc.) to the page labels (first page can be 1, or "i", or "Cover", or 500, or anything else), and they did it in many places in the application, not just here. It's also the same when you want to print pages, extract them, navigate to them, etc.

Your situation is a bit unique as you have a set of specific requirements that prevent you from doing it, but the issue of using page labels instead of numbers is a global one.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

Hmmm... Interesting. So if I follow you properly, when one sets the Initial View settings (File > Properties > Initial View) and selects for example "Bookmarks Panel and Page", "Two-Up (Cover Page)", "Fit Page" and the like, these are not flags in the PDF document but actions that get executed upon opening the document, in a similar way as document JavaScript gets executed when opening the document? This would explain why the Open Action is an all or nothing... Thank you for that... A bit counter-intuitive because one could really want to leave the "Page Number" unchanged to open on whatever page it was originally decided, but still change the zoom for a good reason. Well, I just learned something, but it does not solve my problem, at least not how I wanted to solve it.

 

Apparently, a plugin could do the trick, but it would require me to install a C compiler and roll-up my sleves, right? I have not programmed in C in like 20 years or so.

 

I finally came up with a "compromise" solution where I wrote an external script with a tool called AutoHotkey. It goes through all the PDF files in a given folder, opens them one at a time, opens the "Document Properties" dialog, jumps to the "Intial View" tab, sets the desired options like Page Layout and Magnification whislt leaving the "Open to page" unchanged", presses OK and saves the file. It is probably slower that the built-in actions, but it gets the job done. The only real drawback is that I cannot use my computer while this is running.

 

Anyway, thank you for your time and clarifications... and you are right, the page labels vs numbers issue does surface in other areas from time to time.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2021 Sep 09, 2021

Copy link to clipboard

Copied

You can do this with just an action. If you use (1), with the parentheses, as the page number in the Open Action dialog, it will open to the first page regardless of the page numbering.

Screen Shot 2021-09-09 at 9.51.43 AM.png

 

E.g. my document was numbered i, ii, iii, 1, 2, 3, 4... and using (1) will open to page i (the first page in the document).

 

I know this thread is a year old now so the correct solution might be out there somewhere else, but it's the first one that came up when I searched the same problem, so I thought I'd post here with the solution I found.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 09, 2021 Sep 09, 2021

Copy link to clipboard

Copied

LATEST

That's an awesome trick! I never knew about using the parentheses! And it works even with the "go to page" command! Amazing, thank you very much for taking the time to chip in!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines