Small ticket printing [web] browser to skip Google Preview Direct printing (lodop)

Because the project needs, need to print a small ticket orders directly in the web client, then the client to send an effective thermal receipt printer. lowlowlow, people are what cloud print. . . .

The product's official website had nothing to stroll around, give the driver installation. Bahrain to select the printer when printing.

but! When the browser print good Sibu Si to a "friendly" print preview page can not be set to ignore!

Considering the scenario is triggered to take meal small ticket printing, multi-step preview confirmation are locomotive, so go of your mother needed to blow off Johnson;

 

Recipe:

(A bunch of search) said the Internet plus "--kiosk-printing" in the path of Google's browser shortcuts

Measure invalid (does not make the wrong way is not open)

 

Recipe:

Looking for a'll find online there is such a thing: LODOP , official euphemistically called "leakage belly."

Here is the key:

1) Printer (if not, please do not waste precious time read on)

2) The printer driver is installed (at least print something inside it in a word document)

3) Go to LODOP official website to download lodop applications  and install

     

4) Download Technical Manual (demo) See the following code or

//首先需要引入js文件,在技术手册包里有
//或者 http://www.lodop.net/demolist/LodopFuncs.js 下载
<script language="javascript" src="LodopFuncs.js"></script>

<script>
//定义一个变量
var lodop;
//程序加载有个加载过程,进页面立即初始化的话,会提示未加载完成
setTimeout(Init,500);
function Init(){
    //需要打印的内容
    var html = "";
    //初始化变量 str1 str2默认不填 ,是注册正版时的验证账号密码
    lodop= getLodop(str1,str2);
    //设置打印页面大小,这里3表示纵向打印且纸高“按内容的高度”;48表示纸宽48mm;20表示页底空白2.0mm
    lodop.SET_PRINT_PAGESIZE(3,48,20,"");
    //设置打印页面内容  10为上边距 0为左边距 100%为宽度 ""为高度,发现不填也没事,html是打印内容                 
    lodop.ADD_PRINT_HTM(10,0,"100%","",html);
}

//执行lodop_print()即可直接打印
function lodop_print(){
    //打印操作
    lodop.PRINT();
}
</script>

5) direct printing, you will find a small ticket [bottom] lodop trial of logo, because customers reluctant to pay, do not bother to take the time to look for an approach to, and are interested can learn under the 14-year tutorial  https://blog.csdn.net/luoyehanfei/article/details/42040961  not pro-test

 

final, but also the water article

Published 35 original articles · won praise 18 · views 370 000 +

Guess you like

Origin blog.csdn.net/TXX_c/article/details/82745707