你也太狠了吧?如果我的机器是你对象,我可是怕怕
打印纸的大小你可以通过一些已经有安全签名的控件来搞这种事情
这个是上次别人贴的代码
-------------------------------------------------------------------
<html>
<title>打印确认</title>
<style media="print">
.noprint { display: none }
</style>
</head>
<body>
<object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"></object>
<script defer>
function window.onload() {
//factory.printing.paperSize = "A3"
factory.printing.header = ""
factory.printing.footer = ""
factory.printing.portrait = false
idPrint1.disabled = false; // enable UI button
idPrint2.disabled = false;
idPrint3.disabled = false;
idPrint4.disabled = false;
factory.printing.leftMargin = 0
factory.printing.topMargin = 5
factory.printing.rightMargin = 5
factory.printing.bottomMargin = 5
}
</script>
<span style="text-decoration:underline">下划线</span>
<U>dsfaldj但是拉夫;飞机士大夫按时地方螺丝钉机发射点</U>
<div class=noprint>
<input id="idPrint1" type="button" value="打印本页"
onclick="factory.printing.Print(false)">
<input id="idPrint2" type="button" value="页面设置"
onclick="factory.printing.PageSetup()">
<input id="idPrint3" type="button" value="打印预览"
onclick="factory.printing.Preview()">
<input id="idPrint4" type="button"
onclick="window.close()" value="关闭窗口">
</div>
<br/>
<table width="720" border="0" cellspacing="0" cellpadding="0" align="center" >
<tr>
<td bgcolor="#0099ff">
这里是你要打印的内容,上面的按钮不会被打印出来<br/>
factory.printing.paperSize = "A3"
</td>
</tr></table></body></body></html>
打印纸的大小你可以通过一些已经有安全签名的控件来搞这种事情
这个是上次别人贴的代码
-------------------------------------------------------------------
<html>
<title>打印确认</title>
<style media="print">
.noprint { display: none }
</style>
</head>
<body>
<object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"></object>
<script defer>
function window.onload() {
//factory.printing.paperSize = "A3"
factory.printing.header = ""
factory.printing.footer = ""
factory.printing.portrait = false
idPrint1.disabled = false; // enable UI button
idPrint2.disabled = false;
idPrint3.disabled = false;
idPrint4.disabled = false;
factory.printing.leftMargin = 0
factory.printing.topMargin = 5
factory.printing.rightMargin = 5
factory.printing.bottomMargin = 5
}
</script>
<span style="text-decoration:underline">下划线</span>
<U>dsfaldj但是拉夫;飞机士大夫按时地方螺丝钉机发射点</U>
<div class=noprint>
<input id="idPrint1" type="button" value="打印本页"
onclick="factory.printing.Print(false)">
<input id="idPrint2" type="button" value="页面设置"
onclick="factory.printing.PageSetup()">
<input id="idPrint3" type="button" value="打印预览"
onclick="factory.printing.Preview()">
<input id="idPrint4" type="button"
onclick="window.close()" value="关闭窗口">
</div>
<br/>
<table width="720" border="0" cellspacing="0" cellpadding="0" align="center" >
<tr>
<td bgcolor="#0099ff">
这里是你要打印的内容,上面的按钮不会被打印出来<br/>
factory.printing.paperSize = "A3"
</td>
</tr></table></body></body></html>
你可以参考一下:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\PageSetup
你可以对下面的两个键值,header和footer进行设置.
另外,你说的打印线我不知道是什么意思.
1.wsh,利用脚本宿主来做
2.用VB或者其它什么东西,写一个Dll或者ActiveX来做这事,用JS来调方法.
请参阅
WshShell 对象 | RegDelete 方法 | RegRead 方法
语言
JScriptVBScript显示所有语言
创建新项、将另一个值名添加到现有的项中(为其指派一个值),或更改现有值名的值。object.RegWrite(strName, anyValue [,strType])
参数
object
WshShell 对象。
strName
表示要创建、添加或更改的项名、值名或值的字符串值。
anyValue
要创建的新项名称、要添加到现有项中的值名或要指派给现有值名的新值。
strType
可选。表示值的数据类型的字符串值。
说明
可通过用最后的反斜线终止 strName 来指定项名。指定值名时最后不要包括反斜线。RegWrite 方法自动将 anyValue 参数转换成字符串或整数。strType 的值确定它的数据类型(字符串或整数)。下表列出用于 strType 的选项。转换成 strType
字符串 REG_SZ
字符串 REG_EXPAND_SZ
整数 REG_DWORD
字符串 REG_BINARY 注意 RegWrite 方法不支持 REG_MULTI_SZ 类型。
提示 RegWrite 最多会将一个 DWORD 写入一个 REG_BINARY 值。该方法不支持 Larger 值。
完全限定的项名和值名的前缀为根项。可以将缩写版本的根项名称用于 RegWrite 方法。下表中列出了五个根项。
根项名 缩写
HKEY_CURRENT_USER HKCU
HKEY_LOCAL_MACHINE HKLM
HKEY_CLASSES_ROOT HKCR
HKEY_USERS HKEY_USERS
HKEY_CURRENT_CONFIG HKEY_CURRENT_CONFIG 下表列出了用 strType 指定的四个可能的数据类型。类型 说明 形式
REG_SZ 字符串 字符串
REG_DWORD 数字 整数
REG_BINARY 二进制值 整数
REG_EXPAND_SZ 可扩展的字符串(例如,"%windir%\\calc.exe") 字符串 示例
下面的代码创建一个项和两个值,读取它们,然后删除它们。[VBScript]
Dim WshShell, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\", 1, "REG_BINARY"
WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\MindReader", "Goocher!", "REG_SZ"bKey = WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\")
WScript.Echo WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\MindReader")WshShell.RegDelete "HKCU\Software\ACME\FortuneTeller\MindReader"
WshShell.RegDelete "HKCU\Software\ACME\FortuneTeller\"
WshShell.RegDelete "HKCU\Software\ACME\"
[JScript]
var WshShell = WScript.CreateObject("WScript.Shell");WshShell.RegWrite ("HKCU\\Software\\ACME\\FortuneTeller\\", 1, "REG_BINARY");
WshShell.RegWrite ("HKCU\\Software\\ACME\\FortuneTeller\\MindReader", "Goocher!", "REG_SZ");var bKey = WshShell.RegRead ("HKCU\\Software\\ACME\\FortuneTeller\\");
WScript.Echo (WshShell.RegRead ("HKCU\\Software\\ACME\\FortuneTeller\\MindReader"));WshShell.RegDelete ("HKCU\\Software\\ACME\\FortuneTeller\\MindReader");
WshShell.RegDelete ("HKCU\\Software\\ACME\\FortuneTeller\\");
WshShell.RegDelete ("HKCU\\Software\\ACME\\");
请参阅
WshShell 对象 | RegDelete 方法 | RegRead 方法--------------------------------------------------------------------------------© 2001 Microsoft Corporation. 保留所有权利。