The key to understanding InDesign's pixel-based RGB document modes is that ID "thinks" 1px=1pt. Acrobat, it turns out, wouldn't know a pixel if it met one at a birthday party; it only understands points, inches, millimeters, etc. So you can get into quite a tangle with it.
Be aware that the "96ppi" you're selecting in the Interactive PDF output applies ONLY to images within the document, not the document as a whole.
InDesign is locked into 72 points = 1 inch = 72 pixels. The only ways to get a target pixel dimension are to export at 72 ppi or do some math beforehand. Your 30px square in ID, exported at 96ppi, ends up at 96/72 x 30 (4/3 x 30) pixels. This applies to any raster (jpeg, swf) export: you will only get a 1:1 pixel correspondence if you export at 72 ppi.
Problem solved, right? Well, no. It turns out there's another strange dimension to this. Acrobat, as mentioned, doesn't know from pixels. It translates everything you throw at it into linear units. It throws away "pixels per" and retains only "inch" or "mm." But then makes its own decision about how many pixels that is. In other words, as I was somewhat chagrined to discover, it utterly ignores InDesign CS5's pixel dimensions. (The Acrobat engineering team seems to live in splendid isolation, paying no attention at all to anything else going on at Adobe. It's been an annoyance for years.)
So, either change your PDF document resolution to 72 ppi (in Acrobat, Preferences > Page Display
and set a Custom Resolution of 72 pixels/inch), or, if you don't want to do that, use this workaround:
Set up your InDesign document at the pixel width
A
you want to end up with.Export to PDF and measure the result
B
.Divide A by B to give you a scaling factor
S
. (Copy to the clipboard, ideally.)In InDesign, go to
File > Document Setup
and in the width field, after what is already there, add*0.65656565
(or whateverS
was). Tab to the height field and do the same.
Your document will now export to PDF at your original target pixel dimensions, and the elements within it will also be correct. Be sure to change the document properties so that the Initial View is "100%".