Page 1 of 1

Is there a way to add a PageOpen javascript to every page?

Posted: Thu May 03, 2018 9:54 pm
by mmitchell_houston
I have a bit of javascript code I want to put on each and every page in my document.
Is there a way to quickly do this?
Or do I have to click on each and every page, one-by-one?

Re: Is there a way to add a PageOpen javascript to every page?

Posted: Thu May 03, 2018 11:12 pm
by TrackerSupp-Daniel
Once you've added a button that runs the JS, you should be able to select it and use the Duplicate function to place a copy of it on each page:
Image

Re: Is there a way to add a PageOpen javascript to every page?

Posted: Mon May 07, 2018 11:47 am
by mmitchell_houston
Thank you for the reply (and the tip -- I will remember it), but I'm not using a button to run the JS. As noted in the original post, I am adding a script to the PAGE OPEN event (click on the page thumbnail and you will be able to see the Page Open and Page Close options in the Page Properties panel.

Re: Is there a way to add a PageOpen javascript to every page?

Posted: Mon May 07, 2018 8:12 pm
by TrackerSupp-Daniel
Hi again,
You could try adding it to the document javascript (CTRL+D to open document settings), but you would need to add more parameters so that it could recognize a pageopen from there.
I do not know if there is another method of duplicating these, I will pass this to our dev support and see if they have any ideas for you on the mater.

Re: Is there a way to add a PageOpen javascript to every page?

Posted: Tue May 08, 2018 1:18 pm
by mmitchell_houston
I looked into the Document properties, and cannot figure out how to get it to add anything that can simulate a PageOpen event at that level. I suppose it might be possible to craft some sort of "listener" script, but for the life of me, I cannot find anyone who has documented how to do it.

Any progress on your end?

On my end, I'm looking into whether I can add the Javascript from the InDesign side of things.

Re: Is there a way to add a PageOpen javascript to every page?

Posted: Tue Jun 05, 2018 3:18 pm
by mmitchell_houston
Has there been any progress on this issue? I would love to resolve this issue before starting the next iteration of my project.

Mike

PS: Or if anyone can think of how I could extend the Document Open event to "sniff" out the Page Open and Page Close events, that would work, too.In fact, that would be great!

Re: Is there a way to add a PageOpen javascript to every page?

Posted: Tue Jun 05, 2018 8:15 pm
by TrackerSupp-Daniel
Hello again,

Sorry for the delay, it doesn't seem it would be feasible to do this recursively on all document pages using JS. Conversely it should be doable using our SDK products. The Editor SDK is available as a free download here: https://www.pdf-xchange.com/produc ... editor-sdk

This will allow you to experiment with it (if you wish) and find a way to implement recursive JS to the document before making the purchase.