These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Reversing pages.. JavaScript in Acrobat X and complaints galore

simplemadecomplex
Registered: Jan 28 2011
Posts: 2
Answered

I just have to vent after having just spent over an hour trying to find out how to use Javascript with Adobe Acrobat X to reverse and reorder pages. This is the most basic function to have in a program like this (nevermind having to use JavaScript to do it), but what I had to do was to find the proper JavaScript from some forum online, then go to JavaScript under the Tools menu, and when I get there, you can't actually just create it as a macro/action and make it run then and there. :O You have to embed it into some premade action like when the document saves? WHY is there JavaScript support if it's going to be implemented like that? Please tell me I'm missing something here!
 
The other problem with Adobe Acrobat X, at least on OSX, is that you can't do this manually without having a mental breakdown. Think about how thumbnails are handled in Pages. I would be happy to reverse the pages manually, as it would've taken all of 15-20 minutes, but it takes AGES to reload the page thumbnails every time you scroll (which is very jittery so you never get to the page you want) and every time you move a page, and there is no way of reversing the pages without actually having these thumbnails up.
 
Adobe could learn a thing or two from people who make decent, optimized PDF readers, especially on mobile devices, where they know how to preload the nearest pages in the background to reduce loading times for pages and make it a better experience, and they know that when a user scrolls, your best bet is to show placeholders (page numbers maybe) or very simple bitmap rendering of a page, and don't try to load the actual content of a page until the user stops there. This is coding 101, but Adobe doesn't seem to care about that.

My Product Information:
Acrobat Standard 10.0, Macintosh
simplemadecomplex
Registered: Jan 28 2011
Posts: 2
Accepted Answer
Ok for anyone who might have problems with this at some point... Go under the 'Action Wizard' under Tools and select 'Create New Action'. From the left menu select 'More Tools'. From here select 'Execute JavaScript'. Here you can write your script by clicking on the icon under 'Options'. This works fine and does what exactly what I want (execute JS when clicked). I'm still really annoyed with how slow it is but in relation to JS and scripting Actions which is what this section is about, this was my own fault and hopefully this helps someone else from having the same experience! Sorry.
UVSAR
Online
Expert
Registered: Oct 29 2008
Posts: 1357
JavaScript in Acrobat is not the same as scripting in other applications such as Photoshop. Scripts *can* be run in the context of the application, either to modify the user interface or run something within an Action; but the dominant use is to embed scripts inside a PDF document itself, to perform interactive and dynamic tasks such as controlling form fields or managing multimedia.

The JavaScript tools panel in Acrobat X relates to the latter workflow, where scripts are attached to a document or react to an event that the document triggers. To run a script in the application context it can either be written as a standard .JS (text) file and copied into the Acrobat/Javascript folder (where it is typically accessed via a new tool or menu item the script creates when Acrobat loads), or run through the interactive JS console (cmd-J).

Actions, which are a new feature in Acrobat X, replace the batch scripting interface with a more visual workflow that the target users have asked for. Although Actions can and often do use JS steps to perform advanced functions, scripting is considered a power user task and so does not have priority on the UI.


As to the pages thumbnail question, there are two points to note. Firstly, PDF files can embed their page thumbnails as part of the creation process, which speeds up the UI render of the Navigation Panel. Secondly, rendering thumbnails is always going to involve intensive processing when the document is complex, as PDF pages tend to be a mix of vector and raster objects, embedded fonts and layers. The low-level classes to scale a single bitmap are extremely fast, but Acrobat and Reader have a lot more work to do.
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
simplemadecomplex wrote:
I just have to vent after having just spent over an hour trying to find out how to use Javascript with Adobe Acrobat X to reverse and reorder pages. This is the most basic function to have in a program like this
See : https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=46