Jump to content

modify print script


flemingmike

Recommended Posts

hello,  i have the following script, and it works great.  one thing i need is to print in landscape.  is it possible to modify this to set to print landscape?

 

<head>
<script><!--
function printURL(URL){
if(!window.print){
	alert("Your browser does not support printing");
}
else{
	popup = window.open("about:blank", "", "fullscreen=no,toolbar=no,status=no,menubar=yes,scrollbars=no,resizable=no,directories=no,location=no,width=200,height=200");
	popup.document.write("<html><frameset cols=*><frame src=\"" +URL+ "\" onload=\"window.print();setTimeout('window.close()',100) \"></frame></frameset></html>");
	popup.location.reload();
}
}
--></script>
</head


<body>
<a href="javascript:printURL('shortview.php?">print shortview</a>
</body>

Link to comment
Share on other sites

  • 2 weeks later...

I don't believe you can modify the users settings in javascript, however, you may be able to use some CSS to help

 

in your page "shortview.php" add...

<style type="text/css" media="print">
body{page:landscape}
</style>

and see if that helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.