Thanks for coming to, the world's #1 resource for all things InDesign!

Stacking Order Bug when Exporting to Interactive PDF

I recently encountered a bug in InDesign’s stacking order when exporting to Interactive PDF. Apparently, I am not the only person having this issue, so I wanted to pass along the news and a fix.

I created a layout in InDesign that contained several layers, and objects that had been converted to buttons. In this case, it is a stack of images that together make up a coconut. In InDesign, the looked like this:

InDesign Layout, Properly Stacked

InDesign Layout, Properly Stacked

But when I exported an interactive PDF, this is what I got:

Interactive PDF with Wrong Stacking Order

Interactive PDF with Wrong Stacking Order

Even though each object was on the appropriate layer in InDesign, the stacking order of the layers was totally ignored in the PDF file.

After some experimenting, I found that by exporting to a Print PDF, I could obtain the correct stacking order. And I also found that by converting the different objects from buttons back to regular objects, the stacking order was correct in the PDF. To confirm this, I made a new document and tried to recreate the problem. Here is my layout in InDesign:

Correct Stacking Order in InDesign

Correct Stacking Order in InDesign

But after I converted the objects to buttons and exported an interactive PDF, this is what I got:

Wrong Stacking Order in Interactive PDF

Wrong Stacking Order in Interactive PDF

So I did another experiment with more objects to confirm my suspicion. First I made a correctly stacked layout in InDesign.

CMYK Buttons with Correct Stacking Order

CMYK Buttons with Correct Stacking Order

But I got the following result in the interactive PDF after creating the buttons in this order:

  1. Magenta
  2. Black
  3. Yellow
  4. Cyan
Stacking Order: Magenta, Black, Yellow, Cyan

Stacking Order in Interactive PDF: Magenta, Black, Yellow, Cyan

It turns out that there is a bug in InDesign that affects the stacking order in interactive PDFs. The stacking order is determined by the order in which the buttons are created. Buttons created first go at the bottom of the stacking order in the PDF. I compare it to a stack of paper: a sheet of paper put down first goes at the bottom of the pile. Then, each subsequent piece is stacked on top of it.

So the moral of the story is that if your stacking order is incorrect in an interactive PDF, remake your buttons, in the order opposite of how they should appear in the final PDF. I realize that may be a huge endeavor if you document has lots of buttons with lots of actions.

InDesignSecrets has several other articles on interactive buttons (see related articles, below). You can read the entire discussion on the forums here:

Kelly Vaughn

Kelly Vaughn

Kelly Vaughn (a.k.a. "Document Geek") has over a decade of print and design experience. She holds Adobe Expert Certifications In InDesign, Illustrator, Photoshop, and Acrobat, and specializes in writing and designing technical manuals for the marine industry.
Kelly Vaughn

Latest posts by Kelly Vaughn (see all)

  • - November 30, -0001
Related Articles

35 Comments on “Stacking Order Bug when Exporting to Interactive PDF

  1. I think each time you cut and paste something it’s actually considered a new object by InDesign. So you can avoid having to remake the buttons by cutting and pasting them in place to change their “newness” and thus their stacking order in the PDF.

    Like in your CMYK example, cut the M and Y buttons together and paste them in place. Then cut and paste in place the K button. Then the “age” of the buttons is C M Y K and the PDF will come out with them in that stacking order.

    The same trick works for numbered paragraphs in separate text frames on a spread.

  2. Here’s another workaround: I think it’s easier than re-cutting and pasting.

    Use the Object > Interactive > Set Tab Order dialog. If you name your buttons (always a good idea), arrange them in bottom-to-top order: Cyan, Magenta, Yellow, Black.

    Then you’ll appear in that stacking order from back to front.

    • Well sure, if you want to be all organized and professional about it ;)

      It could also be a little confusing at first since as you say the order is reversed (you’d to click the Move Up to move a button down in the PDF stacking order).

    • Wow, thank you so much for this. I had figured out that re-building the button fixed the stacking order, but then I had to re-create the actions for each button, and it was taking me forever.

      After reading this I assigned a new shortcut key to “Set Tab Order” and I had the whole 130 page document fixed in less than half an hour. Yay!

      • Karin, if you go to the Edit menu and select “Keyboard Shortcuts…” down at the bottom, you’ll get to the Keyboard Shortcuts editor. Then find the “Interactive: Set Tab Order…” item under the Object Menu section and assign it a new shortcut at the bottom. I set mine to Ctrl+Opt+Cmd+R, since I was editing the appearance of rollover effects in my document.

  3. As the stacking order is also the tab order, you can get your stacking in order in Acrobat, by opening the Forms Edit mode and adjust the (button) fields in the Fields panel with manual tab order selected.

    • Replying to myself? I would not really consider it a bug, but a shortcoming.

      In PDF, annotations (to which form fields also belong) are by default stacked in the order of creation, and it requires an additional step to change the order of references to the objects, as mentioned by Mike Rankin.

      It would, of course, be a nice feature to have, if the stacking order for the fields would be taken from the general stacking order in the InDesign document.

  4. There stacking order is also a problem in accessible print PDFs. The reading order is supposed to derive form the articles panel which is a top down order. However, the stacking order which is bottom up will trump the article order every time. I don’t know why Adobe doesn’t just make them both top down which is more logical. Top down effects appearance of course, which can leave you with a problem if you have many graphics under type and you want the type to read first.

  5. I also discovered stacking order problems in both ID6 print documents and export to print pdf.

    Even with separate layers, with the items needed to be above all others, using Bring to Front for lines/strokes for a grid of images, InDesign refuses to place the vertical stroke lines in front.

    Definitely a bug.

  6. Actually no!

    it doesn’t work!
    I made all the buttons in reversed time stamp like indicated above but it didn’t work for me!

    indesign :
    Layer 1 (button)
    Layer 2 (button)
    Layer 3 (button)
    Layer 4 (button)

    export interactive pdf:
    Layer 2 (button)
    Layer 1 (button)
    Layer 4 (button)
    Layer 3 (button)

  7. Seriously how RETARDED are Adobe???

    to sell a product which is totally dysfunctional & has put me in HUGE trouble!
    i feelike suing them!!!

    im so pissed for the waste of time all this is causing me!
    I had a deadline to respect & because of them I have PASSED it! & still haven’t found a solution which works!

  8. There are soooo many of my buttons which aren’t functioning anymore after being exported to interactive pdf!
    Im pulling my hair!

    I Hate indesign finally! Ive lost soooo much time because of all this! it’s ridiculous!
    Worst softwarEVER!!

    Also I don’t understand… if I export my file in Swf.. apparently it can’t be seen on iPad right?
    Can someone be kind enough to come forward & help here??

    • strawberrycupcake: I’m sorry you’re having trouble here, but it’s true that making complicated interactive PDF documents is… well, complicated. Often the problem is Acrobat, not InDesign. There are many things that don’t work right when you export to interactive PDF currently, including animations, etc.

      You are right that SWF cannot be viewed on an iPad. But I have some bad news for you: BUTTONS cannot be viewed on an iPad in most PDF readers (including currently Adobe’s). So if you’re relying on buttons, your PDF is probably not going to work correctly on an iPad.

      • One problem is that InDesign can create active elements which can not be represented in PDF. Most is caused because it creates eye candy, but if I remember correctly, there are some elements which are simply illegal in PDF (such as three-state checkboxes).

        Most of these active elements use Flash, which can be used with PDF, but then limits the user to Adobe PDF viewers on the desktop.

        One can understand that PDF is not only output path for interactive documents in InDesign, so one has to expect issues somewhere.

        Another thing appears with this issue as well: how little the various kingdoms at Adobe talk to each other, and how little enterprise-wide base technology planning there is…

      • Can you not use a primer/fallback in the same way web developers would have to?

        EG… Use your animated SWF and below it, place the flat image fallback. The idea being, on devices that do not support swf and thus don’t show it with the pdf they have the fallback showing instead?

        I’m not sure its the worst software ever to be perfectly honest. Interactivity is not it’s primary function so any extras are always going to have their shortfalls. And it’s worth remembering that it was Apples call to not support SWF on IOS devices, not Adobe’s

        HTML 5 support would be ideal but then you’d need to be able to handle the coding skills, where primers are paramount!!

  9. Just in case anyone is still wondering about this, the button stacking order can be fixed in Object -> Interactive -> Set tab order. BUT arrange the buttons in the OPPOSITE order to how they are in the layers.

    I had a map with flags appearing when place names were pressed, some of them overlap and were in the wrong order even though the layer order was right. I set the interactive tabs in the opposite order and it looks ok.

    I have also had problems with buttons that contain more than one objects on different parts of the page, and Indesign creates a bounding box around all the objects on each button, which can prevent you clicking on other buttons. I’ve found the only way around this is to split the objects into separate buttons layers, and do the extra linking in the ‘buttons and forms’ box. Using the eg above, I split my layers from 1. Titles 2. Flags & Titles selected (which was the title in a bolder colour), to 1. Titles 2. Flads 3. Titles selected.

  10. I have a document that has interactive buttons with drop downs. These drop downs cross each other in places. I concur that that button created last appears on top but what happens if you need the button you are currently interacting with to be on top. I need this function. Maybe some javascript contain in each button. Please help.

  11. To fix this all I did was change the document set up to interactive not print. Colors should be RGB not CMYK.
    The document I inherited and fixed had many buttons, master page buttons and several layers.

  12. Hello!

    I have a question for you. I would like to create a button in indesign/acrobat that allows users to upload a picture or file. I have the javascript, but was wondering if I could change the shape of the object so that when a user uploads an image, it expands to the shape. I would like to use other shapes than just rectangle or square. The only way I know to allow a user to upload a picture of their own to the interactive pdf is to use the javascript associated with a button. Do you know another way I can accomplish this goal?

    Thank you so much for your help!

    Mandy Fyhrie

  13. This one worked for me:

    After exporting the Interactive PDF, my buttons were always above a logo I was using.
    After a lot of research and no solutions, I came up with this idea: I converted the logo into a button. It worked.

  14. HI, I see there are a lot of issues with the problem I am now experiencing. Without complaining too much, I just need to deliver the document to the client and I can’t the shape it is in.

    I have tried reordering the tabs to no avail and I tried the cut and pasting methods to no avail, in fact the interactivity is worse now. :-(. I tried the Acrobat form reordering, nothing seems to be working. There are over 150 buttons and I just can’t bring myself to start again, Adobe expert just pointed me at this page. Can anyone suggest what I might be doing wrong? Many thanks in advance. D

    • Hey Dave, this issue raises its ugly head again. I never found a good answer and the doc I was working on at the time have near a thousand interactive elements. Have you tried in Acrobat to cut the items off 1 by 1 and past them back on. Starting at the back and leaving the things you want in front until last? I don’t remember if I even tried this…but give it a go. After that maybe change tab order & name in acrobat? Other than those suggestions I can’t really assist. Sorry.

    • It is (nevertheless) recommended to do the stacking of buttons (and further works with them) in Acrobat (Pro).

      However, Acrobat (since about X) has a sometimes useful, but most of the times horrendously crappy way to control the stacking order of fields (such as buttons).

      First and foremost, the stacking order of fields is represented by its tab order.

      First thing to make sure when you need control over the stacking order is to go to the Forms tab of the Acrobat Preferences and to uncheck “Adjust tab order when modifying fields”. This is crucial, and should be factory default.

      Open the document, and switch to the Forms tool panel. Right of the FIELDS label, you have a dropdown where you can specify the tab order. Set it to “unspecified”. Then to to the left hand side Pages panel, select your page and display the page properties. If in the Tab Order tab you have either no selection, or unspecified, you are fine, otherwise switch to unspecified, and check again in the Forms tool.

      With this preparation, you nof finally can kind of reliably control the tab order (in other words the stacking order) by dragging the fields in the fields list.

      Note that the above works with fields; if you are using non-standard buttons (as InDesign sometimes creates), it won’t work, and you will have to rely on the “paste in the right order” method.

  15. I know we are about 5.5 years since this issue was first raised but since it is still present and I did not see what ended up working for me listed, I thought I’d share my work around.

    My issue was buttons were appearing on top of text/photo content that they were supposed to “hide behind and then “slide” out when hovered on. Make sure these new “faux buttons” are below an other content in your Object>Interactive>Tab Order menu.

    To get them to appear behind the objects, I just had to make the objects in the foreground buttons with no action or rollover state attached to them. It’s still not a flawless execution but it did resolve the issues for my layout when just changing the tab order did nothing. Good luck to you all.

Leave a Reply

Your email address will not be published. Required fields are marked *