87,991
社区成员
发帖
与我相关
我的任务
分享
<script language="Javascript">
//横向打印设置
function pageprint() {
document.all("print").style.display="none";
factory.printing.header = "";
factory.printing.footer = "";
factory.printing.portrait = false; //portrait是指打印方向,设置为true就是纵向,false就是横向。
factory.DoPrint(false); //设置为false,直接打印
document.all("print").style.display="";
}
//打印预览
function pagePrintView(){
document.all("print").style.display="none";
factory.printing.header = "";
factory.printing.footer = "";
factory.printing.portrait = false; //portrait是指打印方向,设置为true就是纵向,false就是横向。
factory.printing.Preview();//打印预览
document.all("print").style.display="";
}
function pagePrintSet(){
factory.printing.PageSetup();//打印设置
}
</script>
<p>打印测试页面</p>
<div style="position:absolute;top:26px;left:103px;" id="print">
<!-- 打印 -->
<span style="font-family:'Arial',sans-serif;font-size:22.964;"><input value="打 印" type="button" onClick="pageprint()"/></span>
<span style="font-family:'Arial',sans-serif;font-size:22.964;"><input value="打印预览" type="button" onClick="pagePrintView()"/></span>
<span style="font-family:'Arial',sans-serif;font-size:22.964;"><input value="打印设置" type="button" onClick="pagePrintSet()"/></span>
</div>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<p>打印测试页面</p>
<div style="position:absolute;top:26px;left:103px;" id="print">
<!-- 打印 -->
<span style="font-family:'Arial',sans-serif;font-size:22.964;"><input value="打 印" type="button" onClick="pageprint()"/></span>
<span style="font-family:'Arial',sans-serif;font-size:22.964;"><input value="打印预览" type="button" onClick="pagePrintView()"/></span>
<span style="font-family:'Arial',sans-serif;font-size:22.964;"><input value="打印设置" type="button" onClick="pagePrintSet()"/></span>
</div>
<script language="Javascript">
<object id="factory" style="display:none" classid="clsid:1663ed6a-23eb-11d2-b92f-008048fdd814"
codebase="smsx.cab#VVersion=6,5,439,72" viewastext></object>
//横向打印设置
function pageprint() {
document.all("print").style.display="none";
factory.printing.header = "";
factory.printing.footer = "";
factory.printing.portrait = false; //portrait是指打印方向,设置为true就是纵向,false就是横向。
factory.DoPrint(false); //设置为false,直接打印
document.all("print").style.display="";
}
//打印预览
function pagePrintView(){
document.all("print").style.display="none";
factory.printing.header = "";
factory.printing.footer = "";
factory.printing.portrait = false; //portrait是指打印方向,设置为true就是纵向,false就是横向。
factory.printing.Preview();//打印预览
document.all("print").style.display="";
}
function pagePrintSet(){
factory.printing.PageSetup();//打印设置
}
</script>
</BODY>
</HTML>
其他浏览器,比如搜狗浏览器和火狐浏览器根本就弹不出那个提示。[/quote]
用 activex 只能在IE 核心的浏览器里用[/quote]
点击“允许阻止的内容”后,怎么没反应呢?没下载这个控件
其他浏览器,比如搜狗浏览器和火狐浏览器根本就弹不出那个提示。[/quote]
用 activex 只能在IE 核心的浏览器里用