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
https://forums.phpfreaks.com/topic/214770-modify-print-script/
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
https://forums.phpfreaks.com/topic/214770-modify-print-script/#findComment-1120233
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.