is now part of CreativePro.com!

New script to output single pages to Interactive PDF

33 0

In InDesign CS5, if you output a facing pages document using the “Adobe PDF (Interactive)” export option, the facing pages always output as spreads. There isn’t any way in the user interface to choose to output individual pages instead of spreads.

But, I realized recently that in the scripting model there’s a command to toggle spread output on and off for interactive PDF export. So I whipped up a quick script to expose this.

You can download the “InteractivePDFSpreads ON/OFF” scripts here.

Using the scripts is simple. If you want to make all future Interactive PDFs export as single pages, run the “InteractivePDFSpreadsOFF” script, and then export as many PDFs as you want using the “Adobe PDF (Interactive)” option. If at any point in the future you wish to output interactive PDFs as spreads, just run the “InteractivePDFSpreadsON” script.

I hope you find this little script useful!

More after the jump! Continue reading below
Free and Premium members see fewer ads! Sign up and log-in today.
Keith Gilbert is a design consultant, developer, educator, speaker, and author. His work has taken him throughout North America, Africa, Europe, and Asia. During his 35+ year career his clients have included Adobe, Apple, Target, Oracle, and the United Nations. He is the author of several popular titles for LinkedIn Learning, Adobe Press, and CreativePro. Find him at gilbertconsulting.com and on Twitter @gilbertconsult
  • Eugene Tyson says:

    Thank you Keith! You’re the man!

  • James Fritz says:

    That is a fantastic script. Thanks Keith!

  • F vd Geest says:

    Still, if you have spreads and master pages this messes things up…

  • loic says:

    I didn’t try your script but it’s truly amazing the number of settings you can set through scripting without ever finding them in the UI.
    I never used but noticed you could use datamerge in the native document instead of a new one :

    DataMergeOption.createNewDocument  
    Data Type: Boolean
    Adobe InDesign CS5 (3.0) Object Model
    If true, creates a new document when records are merged.

    Which is unless I am wrong not possible in the UI. And there are plenty examples.

  • Scott Citron Scott Citron says:

    This is great, Keith. Many thanks!

  • Harbs says:

    @Keith,

    Not to be the party-pooper, but I think we had this discussion already… ;-)

    https://creativepro.com/interactive-pdf-from-indesign-cs5-always-has-spreads-on.php#comment-485137

    I think this can use repeating though… :-)

  • @Harbs, I’m embarrassed. As I’ve always said, “I have a good memory…but it’s short.”

    Somehow, I completely forgot about that August post. That’ll teach me to do a little more searching before I post. I guess I was just so excited about running across the access to spread export (again) in the ID object model I just had to share it.

    Thanks for pointing this out. The original post has a lot of good discussion about this topic.

  • Harbs says:

    No sweat. Like I said, reinforcing this possibility is not a bad thing! :)

    There’s so much info on ID Secrets that some of it is bound to be repeated!

  • SHR1966 says:

    Good point Harbs, but the solutions on that posting leave a lot to be desired. This seems to be a better solution that does not force you to change the document setup and still use the Export to PDF [Interactive] feature.
    FvdGeest. Not sure how this messes up spreads. I am currently testing this and so far no issues. Could you elaborate?
    Kieth, Great solution! Thank you for posting this.

  • Harbs says:

    @SHR1966 ,

    My link was to the comments where there were a number of scripts posted very similar to Keith’s (the first of them being mine)… ;)

  • Marlene says:

    This is awesome. Thank you so much for the script.

  • designspitz says:

    Keith,
    thanks for this script.
    But I have a few questions.
    When I place navigation buttons on a masterpage, they disappear in the PDF after using the script.
    When I place navigation buttons on a document page, the buttons appear on in the middel of the page.
    Dooes anyone have any experience with this behaviour.
    Thnx.

  • Ditte Broendum says:

    @designspitz
    @Keith
    I have the same troubles with navigationbuttons.
    ….I have been seaching alot for a solution, but can not find it.
    Can anybody help?

  • @designspitz/@Ditte: I finally had a chance to test what you described, and you’re right. To clarify:

    Running the InteractivePDFSpreadsON script works fine. But after running the InteractivePDFSpreadsOFF script, master page interactive buttons disappear or move toward the center of the page in the resulting PDF. The same thing happens with Harbs’ script, which is to be expected because both scripts make use of the same commands.

    The only workaround I can suggest right now is that deleting the ID preferences files after running the InteractivePDFSpreadsOFF script makes the buttons move back to their original location in the next exported PDF.

    The script isn’t doing anything to move the buttons in the resulting PDF. There is some undocumented “feature” or “bug” in the undocumented scripting call that we are using to turn PDF spreads on and off. Perhaps this is why Adobe doesn’t have a spreads option appear in the Interactive PDF export dialog box!

  • Laurie R. says:

    The script is cool, but forgive me if I am missing something. When I export an InDesign CS5 PDF from a book file, at the bottom of the screen is a pop-up menu that gives two options. The default, “Adobe PDF (Interactive),” exports in spreads only. But if you choose “Adobe PDF (Print),” you see the standard PDF export options, including the option to output in spreads (which, by the way, is not selected by default). If you export using Adobe PDF (Print), you will not by default end up with a PDF in spread format.

  • Pascal Maramis says:

    Very nice, thanks. The script helped a lot.

    With kind regards.

    Pascal

  • Eugene Tyson says:

    A little KINK – in this. I had to turn spreads back on to get Buttons to appear in the correct place in the PDF.

  • Hi! To add to the above, the CS5 scripts relating to single-page and spread outputs to interactive pdf do a rather odd thing in 5.5. They offset an actual video up and to the left so that it is off the page, although either the frame or a blank space is left on the page. You can see that this has happened by reducing the size of the pdf page when viewing it, so that the outside shows.

    The only way I found to get round this while retaining the spread view in InDesign, was to offset the frame + video in InDesign by trial and error until it produced at about the right place. Then I gave up and went back to single spreads in InDesign. This is not a big deal at the moment, as running heads are the same on both sides, but it will be a problem with a different layout.

    Am I being dumb, or is there not another way round this yet?

    Chazz

  • Michael says:

    Same problem. Can’t use script because the script causes buttons to move to middle of the page over the type. Thanks for at least trying to solve the problem though. It’s very frustrating that Adobe hasn’t fixed the spreads problem in InDesign. I can’t even see a reason for outputting spreads as single pages much less making it impossible to have normal page spreads. If you’re making ebook PDFs (ePDFs) the only solution is to go back to InDesign 4.0 and scrap the Indesign 5.0 and 5.5 upgrades!

  • Marc says:

    Been using InDesign for years but just the intial CS release; have just upgraded to 5.5 and immediately found the interactive PDF spread problem that you have been discussing.

    Found the exact problem with using the scripts, the interactive buttons appear in the middle of the page.

    So, Keith, what are the ID preferences files you refer to in your April 7 post. Where do I find them; how do I delete them? What are the consequences? Are they automatically regenerated at some point?

    Thanks in advance. Am, new to this site, but it is way cool. I’ve found a new resource.

  • Great, Marc, and welcome to the web site! Be sure to check out the Forums and Store, too (links in the top nav)

    AM

  • Marc says:

    Thanks for the welcome, Anne-Marie.

    Has anybody yet come up with a solution to creating an interactive PDF without spread pages but keeping the interactive buttons in the original location?

    Also, where do I go to add my voice to the chorus telling Adobe to fix this?

  • Keith Gilbert says:

    Marc, see https://bit.ly/r34zrz for instructions about deleting the ID preferences files.

  • Keith Gilbert says:

    Marc, see https://adobe.ly/pt7zGa and https://bit.ly/nHjWOq to “add your voice to the chorus” Thx.

  • Marc says:

    Keith, I’ve tried it both ways:

    If I run the script, close InDesign and then restart and delete preferences, the script no longer works.

    If I delete the preferences, run the script and do nothing else, the buttons appear in the middle of the page, and then on the odd pages only.

    Sigh. Someone needs to tell Adobe, “If it ain’t broke, don’t fix it.”

    I have found this workaround, I think, although I need to do a little more testing: If I convert the buttons to Hyperlinks and then run the script, they stay put and give the behavior I want.

  • Ditte Brøndum says:

    @Marc – about your workaround: But then the buttons print on paper – or have you found a way to avoid this?

  • Gabe says:

    THANK YOU SOOOO MUCH! :D

  • Wild says:

    Thank you so much, this is what I needed

  • lilietttt says:

    thank you very much… you are the best! :)

  • victoria says:

    This is fantastic!! Thanks!

  • V.A. says:

    This website –again– saved my deadline, thanks to this script!

  • >