User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,652 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,389 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 79436 | Replies: 24
Reply
Join Date: Aug 2004
Posts: 6
Reputation: vivekgalatage is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vivekgalatage vivekgalatage is offline Offline
Newbie Poster

How to set landscape orientation?

  #1  
Dec 1st, 2004
Hi Guys,

I m writing one HTML page where i wanted the page orientation to be set to LANDSCAPE through Javascript or CSS. So when I click on Print button or anyways on the HTML page, the print window will pop-up so now in that orientation property should be set to LANDSCAPE.

So does anyone know how to accomplish this?

Thanks in advance.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to set landscape orientation?

  #2  
Dec 10th, 2004
The CSS Print Profile specification may help:

http://www.w3.org/TR/2004/CR-css-pri...ion-properties
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: How to set landscape orientation?

  #3  
Dec 10th, 2004
I'm confused how one can set the page orientation of a website. One can simply stretch a browser window to any shape and size they want and if relative values are used for tables and such, the text will stretch along with the window.
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to set landscape orientation?

  #4  
Dec 10th, 2004
Originally Posted by cscgal
I'm confused how one can set the page orientation of a website. One can simply stretch a browser window to any shape and size they want and if relative values are used for tables and such, the text will stretch along with the window.


Dani,

You can apply CSS style rules to create a custom-sized print box. What you cannot do is force the Print Dialog box to default to landscape. CSS and/or JavaScript cannot reach into the system resources.
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,881
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: How to set landscape orientation?

  #5  
Dec 10th, 2004
Oh I see what you're saying. Use JavaScript to load the print dialog box. Gotcha there
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to set landscape orientation?

  #6  
Dec 10th, 2004
No, not quite. The CSS specification allows you to set styles that come into play when the user Prints. So the site may display one way, but when you print, certain elements will be excluded, etc.
Reply With Quote  
Join Date: Jan 2005
Posts: 1
Reputation: scandal_uk is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
scandal_uk scandal_uk is offline Offline
Newbie Poster

Re: How to set landscape orientation?

  #7  
Jan 7th, 2005
The CSS for this is simple (just use class="landscape"):

<style type="text/css" media="print">

@page port {size: portrait;}
@page land {size: landscape;}

.portrait {page: port;}

.landscape {page: land;}

</style>

So there.
Reply With Quote  
Join Date: Feb 2005
Posts: 1
Reputation: jasbrown is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jasbrown jasbrown is offline Offline
Newbie Poster

Re: How to set landscape orientation?

  #8  
Feb 14th, 2005
scandal_uk,

I am trying to test out your CSS code for Landscape Orientation but I cannot seem to be able to make it work. I have created a test page with the following code. What am I doing wrong?

<html>
<head>

<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css" media="print">
@page port {size: portrait;}
@page land {size: landscape;}
.portrait {page: port;}
.landscape {page: land;}
</style>

</head>

<body class="landscape">
<table width="95%" border="0" class="landscape">
<tr class="landscape">
<td class="landscape">1</td>
<td class="landscape">2</td>
<td class="landscape">3</td>
<td class="landscape">4</td>
<td class="landscape">5</td>
<td class="landscape">6</td>
<td class="landscape">7</td>
<td class="landscape">8</td>
<td class="landscape">9</td>
<td class="landscape">10</td>
<td class="landscape">11</td>
<td class="landscape">12</td>
<td class="landscape">13</td>
<td class="landscape">14</td>
<td class="landscape">15</td>
<td class="landscape">16</td>
<td class="landscape">17</td>
<td class="landscape">18</td>
</tr>
</table>
</body>
</html>
Reply With Quote  
Join Date: Mar 2005
Posts: 1
Reputation: greenbirdweb is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
greenbirdweb greenbirdweb is offline Offline
Newbie Poster

Re: How to set landscape orientation?

  #9  
Mar 21st, 2005
I have been attempting the same CSS implementation, but I read in a book today that Opera 6/7 is the only browser which supports the property which sets the orientation.
Reply With Quote  
Join Date: Apr 2005
Posts: 1
Reputation: gangireddy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gangireddy gangireddy is offline Offline
Newbie Poster

Re: How to set landscape orientation?

  #10  
Apr 28th, 2005
Hi vivekgalatage,
Did you find a way to do this?. thanks....
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:21 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC