Quoting John Day <[EMAIL PROTECTED]>: > At 04:19 PM 6/7/2004, John Day wrote: > >I have an application where I want to generate a 'printable invoice' in a > separate window. Preferably I would like the browser page to not have > toolbars and all that, just a simple link at the bottom that has an > 'onClick' event calling the window.print() method in it. How do I set up the > headers to force the output to a new window and how do I turn off all the > unnecessary 'stuff' on the browser window? > > Did I really say that? My brain is scrambled today. No, I want them to print > it by hitting ctrl-P! I can't use the onClick without JS can i!
It did sound rather confusing :) However, even with the clarification, your question really has nothing to do with CGI::Application, which makes me believe that you mistook this list for a general CGI mailing list. That having been said, the easiest way to do this is to use stylesheets. You can provide a stylesheet with the media attribute set to 'print'. <link rel="stylesheet" href="/style/normal.css" type="text/css" media="all"/> <link rel="stylesheet" href="/style/print.css" type="text/css" media="print"/> Then your stylesheet can define what should be visible, or invisible. WHen the user does a print preview, or just a Ctrl-P the result will be rendered using the 'print' stylesheet instead of the 'normal' one. Hope that helps... Cees --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
