自定义动态生成页面打印以及打印预览的一个实现例子
来源:互联网 发布:卢宇彤 知乎 编辑:程序博客网 时间:2024/05/16 06:36
function CallPrint(strid){//打印预览jiangkun
var oriWidth;
//隐藏不需要打印的信息
$('.buttH').hide();
$('.sbu').hide();
var $as = $('a[id^="signatureAI_"]');
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
var sst=_id.split('signatureAI_');
oriWidth=$("#sigCont"+"signature_"+sst[1]).attr('width');
$("#sigCont"+"signature_"+sst[1]).css('width','100%');
});
$as = $('a[id^="opinionAI_"]');
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
$("#"+_id).hide();
});
$('table').attr('align','center');//将table居中
var prtContent = document.getElementById(strid);
var cont=prtContent.innerHTML;
var w=window.screen.width*0.99;
var h=window.screen.height*0.99;
var WinPrint = window.open('', '', 'left=0,top=0,width='+w+',height='+h+',toolbar=0,scrollbars=1,status=0,menubar=0');
var priBut="<input id=printBut onclick=window.close() value=返回 style='height=26px;width=60px;' type=button /><input id=printBut onclick=window.print() value=打印 style='height=26px;width=60px;' type=button />";
WinPrint.document.write(priBut+cont);
WinPrint.document.close();
//显示被打印隐藏的信息
$('.buttH').show();
$('.sbu').show();
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
var sst=_id.split('signatureAI_');
$("#sigCont"+"signature_"+sst[1]).css('width',oriWidth);
});
$as = $('a[id^="opinionAI_"]');
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
$("#"+_id).show();
});
}
var oriWidth;
//隐藏不需要打印的信息
$('.buttH').hide();
$('.sbu').hide();
var $as = $('a[id^="signatureAI_"]');
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
var sst=_id.split('signatureAI_');
oriWidth=$("#sigCont"+"signature_"+sst[1]).attr('width');
$("#sigCont"+"signature_"+sst[1]).css('width','100%');
});
$as = $('a[id^="opinionAI_"]');
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
$("#"+_id).hide();
});
$('table').attr('align','center');//将table居中
var prtContent = document.getElementById(strid);
var cont=prtContent.innerHTML;
var w=window.screen.width*0.99;
var h=window.screen.height*0.99;
var WinPrint = window.open('', '', 'left=0,top=0,width='+w+',height='+h+',toolbar=0,scrollbars=1,status=0,menubar=0');
var priBut="<input id=printBut onclick=window.close() value=返回 style='height=26px;width=60px;' type=button /><input id=printBut onclick=window.print() value=打印 style='height=26px;width=60px;' type=button />";
WinPrint.document.write(priBut+cont);
WinPrint.document.close();
//显示被打印隐藏的信息
$('.buttH').show();
$('.sbu').show();
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
var sst=_id.split('signatureAI_');
$("#sigCont"+"signature_"+sst[1]).css('width',oriWidth);
});
$as = $('a[id^="opinionAI_"]');
$as.each( function(){
var $this=$(this);
var _id=$this.attr("id");
$("#"+_id).show();
});
}
- 自定义动态生成页面打印以及打印预览的一个实现例子
- 动态生成的html页面转pdf并且打印预览
- Qt 打印预览以及打印功能的实现
- 用js实现页面打印以及自定义打印内容
- 打印预览的实现
- 页面设置、打印预览、打印
- javascript 打印预览的实现
- js实现打印、页面设置、打印预览功能
- js实现打印、页面设置、打印预览功能
- 打印预览html页面
- 打印、设置、预览页面
- NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- 开源:.NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- .NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- 开源:.NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- 开源:.NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- .NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现(二)
- .Net环境下有关打印页面设置、打印机设置、打印预览对话框的实现(转)
- One or more breakpoints cannot be set and have been disabled...
- Could not find the main class: Error exist in required project(s);
- 杭电1089
- 宏块到条带组的映射类型及解码
- IE7下position的z-index Bug解决方案
- 自定义动态生成页面打印以及打印预览的一个实现例子
- 在ti-SDK-am335x-evm-05.07.00.00里面编译时若干文件找不到的问题
- 杭电1090
- Linus Torvalds - 从单链表中删除节点
- 初识HAL<一>
- GGrid网页手写签批控件个人实现在页面上自定义显示的一个例子
- android项目反编译和混淆
- 杭电1090
- 关于Http的headers最详细的解释(值得推荐)