Click to See Complete Forum and Search --> : Window.Print()
webdev1
03-05-2003, 12:54 PM
Does anyone know if you can set how you want something to print by using the Window.Print() function. i.e. I want it to print in Landscape. I know you can go to File, Page Setup and change it there, but I want to change it automatically in case the user doesn't realize it needs to be landscape. Any ideas? Thanks.
This question was asked before at the Javascript-weenie discussion email group (that I am a proud member of :p). The answer was to use CSS. The answer is somewhere on the www.w3c.com site, but I am sorry I don't remember where.
webdev1
03-05-2003, 03:11 PM
Does anyone know how to use CSS to do this? I've searched and can't find it. I have a CSS book but it's vs 1 and it claims you can't use CSS to print! Help!
dabush
03-05-2003, 05:01 PM
@PAGE landscape {size: LANDSCAPE;}
TABLE {PAGE: landscape;}
webdev1
03-06-2003, 07:41 AM
Sorry to be a pest but I'm a bit confused. I'm fairly new at using CSS so forgive me for my ignorance. After adding this code to my css file where do I place it in my code (a cfm page)? I tried it but it didn't work. Thanks.
webdev1
03-06-2003, 08:53 AM
Ok, I realize this is no longer a javascript question and more of a CSS question but no one is in the CSS forum so maybe someone here knows how to help me out. I've been picking my brain trying to get this to work. I've tried using the following different things and nothing worked!! HELP!!
<style type="text/css">
@media print
{
BODY {size:landscape}
}
</style>
<style type="text/css">
@media print
{
BODY {style:landscape}
}
</style>
<style type="text/css">
@PAGE landscape {size:landscape;}
TABLE {PAGE: landscape;}
</style>