• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing Html

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a struts action / jsp that generates an HTML page that is intended to be printed and mailed to my company's clients.

On the screen it looks great. The page has background shaded divider bars with text overlaying them (silver background with black text) to separate parts of the page.

Unfortunately, when printed these background colors turn white.

Also, the browser prints headers and footers that are inappropriate to the final document.

Does anyone know of a way to get the browser to keep the background colors and suppress the header and footers?

Thanks,
Chris Elvart
 
Marshal
Posts: 28264
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your browser is Internet Explorer then this option configures it that way: Tools, Internet Options, Advanced, Print background colors and images. I don't see an option in Firefox to do that.

(Edit: in Firefox, do Print Preview, then select Page Setup and the option is right there.)

And to prevent HTML elements from printing, you can use CSS like this:
[ June 21, 2006: Message edited by: Paul Clapham ]
 
Chris Elvart
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.

The print background option works well for me.

I already had css styles to suppress the printing of certain html elements.

What I want to suppress are the page headers and footers that IE puts on the page itself. These are the page title and "page # of #" at the top and the URL and date at the bottom.

Does anyone know how to suppress these?

Chris Elvart
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are settings on the browser htat have to be removed manually. JavaScript can not touch them. Some ActiveX controls can change it, but it is activeX

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic