Landscape Print

maddirala

Freshman
Joined
Oct 21, 2003
Messages
30
Hi
i am doing .net application and when user clicks on button print it has to print landscape automatically without changing their print setups.i would appreciate for any help

thanks
 
i'm assuming this is in asp.net since its in this forum, then you are trying to have the browser print landscape. there is a attribute in the style sheet of the print media type, but from my experience, most browsers dont support it yet.
 
Hi

i am not looking for browser print.i have to keep print button on page when user clicks it it has to print landscape.
 
Derek, that is what i suggested, but I have found that most browsers including the latest IE does not support that. I know other ppl have had the same experience, wondering what are everybody else's results with that?
 
problem in printing landscape

Hi
I downloaded from meadco scriptx control and installed.i put print button on my .net page and calling java script function.i am getting error like object expected.i couldn't figure why.if anyhelp i would appreciate. I just need to print screen vatever user able to see in IE window

here is my code
<SCRIPT language=javascript>
Function printpr(printWhat){
document.all.btnPrint.style.visibility="hidden"
document.all.btnPreview.style.visibility="hidden"

// Set required Output values
factory.printing.portrait = false;
factory.printing.leftMargin = 10.5;
factory.printing.rightMargin = 5.5;
factory.printing.topMargin = 1.5;
factory.printing.bottomMargin = 1.5;
factory.printing.header = "";
factory.printing.footer = "Printed: &d&b&bPage &p/&P";

var OLECMDID = printWhat;
/* OLECMDID values:
* 6 - Print
* 7 - Print preview
* 1 - Open window
* 4 - Save As
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";

document.all.btnPrint.style.visibility="visible"
document.all.btnPreview.style.visibility="visible"
}
</SCRIPT>
<INPUT class="label1" id="Button1" style="Z-INDEX: 137; LEFT: 152px; WIDTH: 80px; POSITION: absolute; TOP: 514px; HEIGHT: 29px" type="submit" value="Print" name="Button1" onclick="return printpr(7);">
 
Last edited:
Back
Top