|
-
Jan 11th, 2002, 05:00 PM
#1
Thread Starter
New Member
Print Template for ASP using sample ATL COM DLL from Microsoft
All I'm really trying to accomplish is to override print settings in IE using a COM DLL and the templateprinter object. The ATL COM DLL is pre-built in an example written by MS, but I just can't get the page orientation to work. Any help would be appreciated.
The Microsoft sample project and code is located at:
http://msdn.microsoft.com/downloads...ine/default.asp
Everything works okay except for printer orientation.
My code in the PT.htm file is as follows:
<!--TOOLBAR_START--><!--TOOLBAR_EXEMPT--><!--TOOLBAR_END-->
<HTML XMLNS:IE>
<HEAD>
<?IMPORT NAMESPACE="IE" IMPLEMENTATION="#default">
<SCRIPT LANGUAGE="JavaScript">
function Init()
{
/*
alert(printer.PageWidth);
alert(printer.PageHeight);
alert(printer.marginTop);
alert(printer.marginBottom);
alert(printer.marginLeft);
alert(printer.marginRight);
*/
window.dialogWidth = "0px";
window.dialogHeight = "0px";
printer.marginRight = 50;
printer.marginLeft = 50;
printer.marginTop = 50;
printer.marginBottom = 50;
printer.orientation = "portrait";
oInterval = window.setInterval("fnRecycle()",100);
printer.showPageSetupDialog();
Done();
}
function Done()
{
window.close();
}
var oInterval = "";
var icounter = 0;
function fnRecycle()
{
icounter += 1;
if(icounter > 30)
{
window.clearInterval();
}
}
</SCRIPT>
</HEAD>
<BODY ONLOAD="Init()" SCROLL="no" style="width:8.5in; height:11.0in">
<IE:TEMPLATEPRINTER ID="printer"/>
</body>
</html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|