tags:

views:

345

answers:

1

Please don't poke me for using IE6 but that's a client's requirement.

My question is, I have an EMBED tag that displays a PDF dynamically depending on the user choice which means the first time the page gets rendered there won't be any EMBED tags but will be when the user picks a choice.

The problem seems to be that when the EMBED tag is flushed to the client side either the container DIV is not expanding enough to accommodate the EMBED tag or the EMBED tag is getting lost somewhere (as if).

On Firefox the EMBED does show-up (even though it's not the desired size) but on IE6 the EMBED is not visible at all (even though it's in the page source). I tried the container DIV to a fixed height (1200px) but didn't help.

The DOM hierarchy is something of,

container DIV contains another container DIV that set to float EMDED tag is within the floated container

Do you see any obvious issues with this model?

Greatly appreciated your help.

Note: It's an ASP.NET app (I don't know if it matters given the messy control ID's it create automatically)

A: 

IE does not support <embed> at all. You have to use an <object> to embed plugins for IE. As usual there are issues with embedding markup, but I think this would be a place to start:

<object type="application/pdf" data="something.pdf" width="(x)" height="(y)">
    <param name="src" value="something.pdf">
</object>

But I'd advise against trying to embed PDF. Some people (including myself) absolutely hate reading a PDF squashed inside the browser. It also requires the user to have a PDF plugin, which is another potentially-insecure piece of net-facing code; PDF reader exploits have been one of the most widespread web attacks over the past year.

Providing a plain PDF link in addition to or instead of the embed will allow you to reach more users, and let them decide themselves whether to download or view the PDF in the browser.

bobince