欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

热敏打印机第三方控件连续打印 热敏打印机连续打印 

程序员文章站 2024-03-19 23:37:23
...
循环等打印异常。解决方法如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>WEB打印控件LODOP的样例八:打印网页图片</title>
<script language="javascript" src="LodopFuncs.js"></script>
</head>
<body>

<p>3:按原图比例(不变形)缩放打印模式,看看<a href="javascript:myPreview3();">打印预览3</a>。</p>

<script language="javascript" type="text/javascript">
        var LODOP; //声明为全局变量
var count=0;
function myPreview3() {
LODOP=getLodop(); 
//LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_打印图片3");
LODOP.SET_PRINT_PAGESIZE(1,580,500,0);
                LODOP.ADD_PRINT_TEXT(10,70,100,40,"溯源码");
LODOP.ADD_PRINT_BARCODE(22,48,128,106,"QRCode","65020100007001000060");
LODOP.ADD_PRINT_TEXT(110,24,325,40,"65020100007001000060")
LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
LODOP.SET_PRINT_STYLEA(0,"Stretch",2);//按原图比例(不变形)缩放模式
LODOP.PRINT();
count=count+1;
if(count<2){
sleep(1000);
myPreview3();
}else{
count=0;
return;
}

};
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
</script>

</body>
</html>