Click to See Complete Forum and Search --> : Make IFrame Print Opaque?!


bryker
May 14th, 2004, 02:35 PM
On my main page (ASP.NET), I have an <img> which contains a map image (sourced from the MapPoint web service). When a user mouses over certain points on this map <img>, I show the user information in an iframe.

Everything looks good...until you print the window.

When you print it, the background of these iframes is transparent, allowing my underlying img to show through. Looks like crap. You can still read the iframe's contents, but I mean it looks like CRAP.

These iframes are pointed (src property) to another page in my app, which delivers the dynamic content. This content-server page has a background color set, as does the iframe itself. Doesn't matter, when it comes to printing. Prints transparent every time.

I've tried setting the (IE-specific) "allowtransparency" attribute explicitly to False, with the same results. I've also tried adding this sort of code to the header:

<style type="text/css" media="print">
iframe { background-color:#ffffff; }
</style>

with zero luck.

Bear in mind, this is ONLY when printing. Looks fine the rest of the time.

I'd appreciate any and all ideas. I can find NOTHING on the net about making iframe backgrounds opaque (but plenty about making them transparent!)

Thanks very much.

apsimmonds
August 13th, 2009, 07:46 PM
Hi Bryker

Have you received a response to your Iframe issue, I am having the same problem and would appreciate any insights you may now have!

PeejAvery
August 13th, 2009, 08:20 PM
Welcome to the forums, apsimmonds. :wave:

Please remember to keep your posts relevant. This thread is over 5 years old. Create a new thread when asking questions.

Xeel
August 14th, 2009, 11:45 AM
I don't understand the issue. "Print" means print on a printer? If so, use hover/hidden div instead of iframe.

Also I am not sure it happens even when printing. Set background color of the content html of the iframe's source, not of the iframe itself, should work just fine...