|
|
Subject:
Printing background in Internet Explorer (scripted)
Category: Computers > Programming Asked by: fluxsmith-ga List Price: $200.00 |
Posted:
03 Nov 2005 15:27 PST
Expires: 03 Dec 2005 15:27 PST Question ID: 588628 |
Internet Explorer has an option (normally off) for printing background colors. I need a webpage on my intranet to be able to turn this option on when it is loaded, so that regardless of the users normal setting, this page prints with the background color(s). I'm looking for some Java script to accomplish this. I know it can be done because MeadCo's ScriptX product can do it in the licensed version (for me this functionality is not worth purchasing an annually licensed product). | |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: Printing background in Internet Explorer (scripted)
From: georgelawrence-ga on 04 Nov 2005 10:23 PST |
I've got an approach that will probably work for you. But I can't figure out how to sign up so I can "Answer" your question. Hmmm... Anyway, can you mock-up one of your pages and post the URL? I'll add my background color printing tequnique to the HTML and you can have a look. |
Subject:
Re: Printing background in Internet Explorer (scripted)
From: fluxsmith-ga on 04 Nov 2005 11:20 PST |
The help would be appreciated. However I have nowhere to readily post a page for you. The background to be printed in the specific instance that prompted the request is just from styling on a table row: <table> <tr style='background-color:#E0E0E0;'> <td>Example</td> </tr> </table> |
Subject:
Re: Printing background in Internet Explorer (scripted)
From: georgelawrence-ga on 04 Nov 2005 12:57 PST |
Cool. I'll mock something up and post it here later on tonight. Hopefully it'll help you. |
Subject:
Re: Printing background in Internet Explorer (scripted)
From: georgelawrence-ga on 07 Nov 2005 00:45 PST |
Sorry, Didn't get a chance to get back to this until now. Anyway... The aproach I took was to paint the grey "background" as an image and not as a background at all. I Googled around and found a simple grey gif. (If you use this approach, you'll of course want to serve this from your own servers.) Then I position the text of the header directly over the grey image. This way the "print backgound colors" setting of the browser doesn't matter, because the background's not a background at all. Example... <html> <table> <tr> <td> <div style="height:1.4em;overflow:hidden"> <div style="height:1.4em"><img style="height:100%;width:100%" src="http://art.sdsu.edu/geninfo/homepages/art240/lessons/vector/images/grey.gif"/></div> <div style="height:1.4em;position:relative;top:-1.4em;;margin-left:2px;margin-top:2px">Header Text</div> </div> </td> </tr> <tr><td>In the table cell of the header above there are 3 divs...</td></tr> <tr><td>1) The first one encloses the next two</td></tr> <tr><td>2) The next one contains a grey gif which is streched to fill the div</td></tr> <tr><td>3) The next one is positioned on top of the previous one and contains the text</td></tr> <tr><td> </td></tr> <tr><td>Note, some versions of IE ignore the overflow css setting when printing.</td></tr> <tr><td>This causes a bit of unwanted space underneath the header.</td></tr> <tr><td>Firefox doesn't seem to have a problem with it.</td></tr> <tr><td> </td></tr> </table> </body> </html> |
Subject:
Re: Printing background in Internet Explorer (scripted)
From: rahulvaja-ga on 03 Dec 2005 08:47 PST |
I'm currently working on print style sheets for my website, and using a javascript:window.print(); link as well. No issues here with it picking up the right style sheet. If it is of any help at all, this is the stylesheet code that I am using: <style type="text/css" title="Style by CSS for screen" media="screen"> @import "displayhtml.css"; </style> <style type="text/css" title="Style by CSS for printer" media="print"> @import "printhtml.css"; </style> I did notice problems early on if I didn't specify 'media="screen"' for the basic style sheet. What would happen is both style sheets would be applied when printing, rather than just the print stylesheet --resulting in some seriously jumbled display. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |