<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('服务公司许可打印')" />
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: lodop" />
</head>
<body style="text-align: center;padding-top: 20px;font-weight: bold;font-size: 20px">
</body>

<script>
	var LODOP = null;
	var printState=0;
	var host="http://"+window.location.host;
	var printData = {
		gsmc:'[[${printData.gsmc}]]',
		gsdz:'[[${printData.gsdz}]]',
		frmc:'[[${printData.frmc}]]',
		management:'[[${printData.management}]]',
		pzwh:'[[${printData.pzwh}]]',
		fzrq:'[[${printData.fzrq}]]',
		xkzh:'[[${printData.xkzh}]]',
		clrq:'[[${printData.clrq}]]',
        zczb: '[[${printData.zczb}]]',
        zf: '[[${printData.zf}]]',
        id:'[[${printData.id}]]',
        companyPic_1_1:'[[${printData.companyPic_1_1}]]',
        companyPic_1_2:'[[${printData.companyPic_1_2}]]',
        companyPic_2_1:'[[${printData.companyPic_2_1}]]',
        companyPic_2_2:'[[${printData.companyPic_2_2}]]',
		qrcode:'[[${printData.qrcode}]]'
	};
	$(function(){
		LODOP = getLodop();
		if(LODOP != null){
            setTimeout("lodopPrint()", 1500);
            var zf = "[[${printData.zf}]]";
            var address = "[[${printData.gsdz}]]";
            if (zf == "f") {//副本
                console.log(host+printData.companyPic_2_1);
                console.log(host+printData.companyPic_2_2);
                if (address.length<14){

                    lodopPrint21();
				}else {

                    lodopPrint22();
				}

            }else {//正本
                if (address.length<14){

                    lodopPrint11();
                }else {

                    lodopPrint12();
                }
			}


		}
	});

	function lodopPrint11(){
		document.body.innerText="打印中...";
        printState=0;
        LODOP.PRINT_INITA("0mm","0mm","359.99mm","260.01mm","保安服务许可证正本-单行");
        LODOP.SET_SHOW_MODE('BKIMG_IN_PREVIEW',1);
        LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='"+host+printData.companyPic_1_1+ "'>");
        LODOP.SET_SHOW_MODE("BKIMG_LEFT",0);
        LODOP.SET_SHOW_MODE("BKIMG_TOP",0);
        LODOP.SET_SHOW_MODE("BKIMG_WIDTH","360.1mm");
        LODOP.SET_SHOW_MODE("BKIMG_HEIGHT","260.09mm");
        LODOP.SET_SHOW_MODE("BKIMG_PRINT",true);
        LODOP.ADD_PRINT_TEXTA("gsmc","105.04mm","88.37mm","174.63mm","7.67mm",printData.gsmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing",15);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("gsdz","123.03mm","88.37mm","174.89mm","8.47mm",printData.gsdz ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("frmc","141.55mm","88.37mm","93.13mm","7.67mm",printData.frmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("fwfw","159.28mm","88.37mm","218.44mm","15.61mm",(printData.management == null || printData.management == "" || printData.management.length < 25)?(printData.management ||''):printData.management.substring(0,24) + '\r\n' + printData.management.substring(24));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing",13);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",-2);
        LODOP.ADD_PRINT_TEXTA("zczb","176.95mm","88.37mm","81.23mm","7.67mm",(printData.zczb==null?"":printData.zczb+"万元人民币"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("pzwh","193.41mm","88.37mm","181.48mm","7.94mm",(printData.pzwh==null?"":("宁公治（保服）【"+printData.pzwh.substring(printData.pzwh.length-8,printData.pzwh.length-4)+"】"+printData.pzwh.substring(printData.pzwh.length-4)+"号")));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("year","222.78mm","279.93mm","19.58mm","9mm",(printData.fzrq==null?"":(printData.fzrq).substring(0,4)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("month","222.78mm","307.18mm","12.44mm","9mm",(printData.fzrq==null?"":(printData.fzrq).substring(5,7)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("day","222.78mm","324.38mm","12.17mm","9mm",(printData.fzrq==null?"":(printData.fzrq).substring(8,10)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("xkzh","89.96mm","236.72mm","109.8mm","9.26mm",(printData.xkzh==null?"":"  "+printData.xkzh.substring(0,printData.xkzh.indexOf('2'))+" "+printData.xkzh.substring(printData.xkzh.indexOf('2'))+"  号"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",23);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("year","234.42mm","279.93mm","19.58mm","9mm","2017");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("month","234.42mm","307.18mm","12.44mm","9mm","10");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("day","234.42mm","324.38mm","12.17mm","9mm","12");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);

        //谷歌浏览器
		if (LODOP.CVERSION) {
			CLODOP.On_Return = function (TaskID, Value) {
				//打印状态
				printState = Value;
				if(printState >= 1) {
					document.body.innerText="打印完成";
                    recordsGenerated(true);
				}else{
					document.body.innerText="已取消打印";
                    recordsGenerated(false);
				}
			};
		}

		printState = LODOP.PRINT_DESIGN();
		//非谷歌
		if (!LODOP.CVERSION) {
			if(printState >= 1) {
				document.body.innerText="打印完成";
                recordsGenerated(true);
			}else{
				document.body.innerText="已取消打印";
                recordsGenerated(false);
			}
		}
	}
    function lodopPrint12(){
        document.body.innerText="打印中...";
        printState=0;
        LODOP.PRINT_INITA("0mm","0mm","359.99mm","260.01mm","保安服务许可证正本-多行");
        LODOP.SET_SHOW_MODE('BKIMG_IN_PREVIEW',1);
        LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0'  src='"+host+printData.companyPic_1_2+ "'>");
        LODOP.SET_SHOW_MODE("BKIMG_LEFT",0);
        LODOP.SET_SHOW_MODE("BKIMG_TOP",0);
        LODOP.SET_SHOW_MODE("BKIMG_WIDTH","360.1mm");
        LODOP.SET_SHOW_MODE("BKIMG_HEIGHT","260.09mm");
        LODOP.SET_SHOW_MODE("BKIMG_PRINT",true);
        LODOP.ADD_PRINT_TEXTA("gsmc","105.83mm","91.02mm","174.63mm","10.32mm",printData.gsmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontSize",22);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("gsdz","123.32mm","91.02mm","174.89mm","10.85mm",printData.gsdz.substring(0,13) + '\r\n' + printData.gsdz.substring(13));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",22);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing","3.97mm");
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("frmc","146.05mm","91.02mm","93.13mm","10.32mm",printData.frmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",22);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("fwfw","162.45mm","91.02mm","218.44mm","18.26mm",(printData.management == null || printData.management == "" || printData.management.length < 25)?(printData.management ||''):printData.management.substring(0,24) + '\r\n' + printData.management.substring(24));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",16);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing","3.44mm");
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","-0.53mm");
        LODOP.ADD_PRINT_TEXTA("zczb","182.03mm","91.02mm","81.23mm","10.32mm",(printData.zczb==null?"":printData.zczb+"万元人民币"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",22);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("pzwh","197.91mm","91.02mm","181.48mm","12.17mm",(printData.pzwh==null?"":("宁公治（保服）【"+printData.pzwh.substring(printData.pzwh.length-8,printData.pzwh.length-4)+"】"+printData.pzwh.substring(printData.pzwh.length-4)+"号")));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",22);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("year","223.04mm","279.66mm","19.58mm","9mm",(printData.fzrq==null?"":(printData.fzrq).substring(0,4)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("month","223.04mm","308.5mm","12.44mm","9mm",(printData.fzrq==null?"":(printData.fzrq).substring(5,7)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("day","223.04mm","325.17mm","12.17mm","9mm",(printData.fzrq==null?"":(printData.fzrq).substring(8,10)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("xkzh","88.32mm","233.28mm","83.87mm","9.26mm",(printData.xkzh==null?"":"  "+printData.xkzh.substring(0,printData.xkzh.indexOf('2'))+" "+printData.xkzh.substring(printData.xkzh.indexOf('2'))+" 号"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",23);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("year","234.69mm","279.4mm","19.58mm","9mm","2018");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("month","234.69mm","307.98mm","12.44mm","9mm","10");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("day","234.69mm","324.11mm","12.17mm","9mm","12");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");

        //谷歌浏览器
        if (LODOP.CVERSION) {
            CLODOP.On_Return = function (TaskID, Value) {
                //打印状态
                printState = Value;
                if(printState >= 1) {
                    document.body.innerText="打印完成";
                    recordsGenerated(true);
                }else{
                    document.body.innerText="已取消打印";
                    recordsGenerated(false);
                }
            };
        }

        printState = LODOP.PRINT_DESIGN();
        //非谷歌
        if (!LODOP.CVERSION) {
            if(printState >= 1) {
                document.body.innerText="打印完成";
                recordsGenerated(true);
            }else{
                document.body.innerText="已取消打印";
                recordsGenerated(false);
            }
        }
    }
    function lodopPrint21(){
        document.body.innerText="打印中...";
        printState=0;
        LODOP.PRINT_INITA("-3mm","0mm","250mm","180mm","保安服务许可证副本单行");
        LODOP.SET_SHOW_MODE('BKIMG_IN_PREVIEW',1);
        LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='"+host+printData.companyPic_2_1+ "'>");
        LODOP.SET_SHOW_MODE("BKIMG_LEFT",0);
        LODOP.SET_SHOW_MODE("BKIMG_TOP",0);
        LODOP.SET_SHOW_MODE("BKIMG_WIDTH","250.03mm");
        LODOP.SET_SHOW_MODE("BKIMG_HEIGHT","179.92mm");
        LODOP.SET_SHOW_MODE("BKIMG_PRINT",true);
        LODOP.ADD_PRINT_TEXTA("gsmc","68.74mm","47.1mm","76.46mm","5.29mm",printData.gsmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("gsdz","79.06mm","47.1mm","76.2mm","5.82mm",printData.gsdz ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("frmc","90.38mm","47.1mm","57.15mm","5.56mm",printData.frmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("fwfw","101.52mm","47.1mm","85.73mm","13.76mm",(printData.management == null || printData.management == "" || printData.management.length < 17)?(printData.management ||''):printData.management.substring(0,16) + '\r\n' + printData.management.substring(16));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing",5);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",1);
        LODOP.ADD_PRINT_TEXTA("zczb","121.76mm","47.1mm","69.85mm","5.29mm",(printData.zczb==null?"":printData.zczb+"万元人民币"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("pzwh","132.16mm","47.1mm","76.7mm","5.29mm",(printData.pzwh==null?"":("宁公治（保服）【"+printData.pzwh.substring(printData.pzwh.length-8,printData.pzwh.length-4)+"】"+printData.pzwh.substring(printData.pzwh.length-4)+"号")));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("year","150.55mm","87.05mm","14.02mm","7.41mm",(printData.fzrq==null?"":(printData.fzrq).substring(0,4)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("month","150.55mm","102.13mm","7.94mm","7.41mm",(printData.fzrq==null?"":(printData.fzrq).substring(5,7)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("day","150.55mm","111.92mm","9mm","7.41mm",(printData.fzrq==null?"":(printData.fzrq).substring(8,10)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("xkzh","49.79mm","42.41mm","65.88mm","6.09mm",(printData.xkzh==null?"":"  "+printData.xkzh.substring(0,printData.xkzh.indexOf('2'))+" "+printData.xkzh.substring(printData.xkzh.indexOf('2'))+"  号"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing",2);
        LODOP.ADD_PRINT_TEXTA("year","157.69mm","83.87mm","14.02mm","7.41mm","2018");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("month","157.69mm","99.48mm","7.94mm","7.41mm","10");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("day","157.69mm","107.95mm","9mm","7.41mm","12");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);

        //谷歌浏览器
        if (LODOP.CVERSION) {
            CLODOP.On_Return = function (TaskID, Value) {
                //打印状态
                printState = Value;
                if(printState >= 1) {
                    document.body.innerText="打印完成";
                    recordsGenerated(true);
                }else{
                    document.body.innerText="已取消打印";
                    recordsGenerated(false);
                }
            };
        }

        printState = LODOP.PRINT_DESIGN();
        //非谷歌
        if (!LODOP.CVERSION) {
            if(printState >= 1) {
                document.body.innerText="打印完成";
                recordsGenerated(true);
            }else{
                document.body.innerText="已取消打印";
                recordsGenerated(false);
            }
        }
    }
    function lodopPrint22(){
        document.body.innerText="打印中...";
        printState=0;
        LODOP.PRINT_INITA("-3mm","0mm","250mm","180mm","保安服务许可证副本多行");
        LODOP.SET_SHOW_MODE('BKIMG_IN_PREVIEW',1);
        LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0'  src='"+host+printData.companyPic_2_2+ "'>");
        LODOP.SET_SHOW_MODE("BKIMG_LEFT",0);
        LODOP.SET_SHOW_MODE("BKIMG_TOP",0);
        LODOP.SET_SHOW_MODE("BKIMG_WIDTH","250.03mm");
        LODOP.SET_SHOW_MODE("BKIMG_HEIGHT","179.92mm");
        LODOP.SET_SHOW_MODE("BKIMG_PRINT",true);
        LODOP.ADD_PRINT_TEXTA("gsmc","64.82mm","50.27mm","76.46mm","6.61mm",printData.gsmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("gsdz","75.54mm","50.27mm","83.87mm","10.05mm",printData.gsdz.substring(0,13) + '\r\n' + printData.gsdz.substring(13));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing","2.65mm");
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.26mm");
        LODOP.ADD_PRINT_TEXTA("frmc","90.49mm","50.27mm","57.15mm","6.88mm",printData.frmc ||'');
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("fwfw","101.12mm","50.27mm","85.73mm","15.08mm",(printData.management == null || printData.management == "" || printData.management.length < 17)?(printData.management ||''):printData.management.substring(0,16) + '\r\n' + printData.management.substring(16));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LineSpacing","1.32mm");
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.26mm");
        LODOP.ADD_PRINT_TEXTA("zczb","121.66mm","50.27mm","69.85mm","6.61mm",(printData.zczb==null?"":printData.zczb+"万元人民币"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("pzwh","132.05mm","50.27mm","169.31mm","5.29mm",(printData.pzwh==null?"":("宁公治（保服）【"+printData.pzwh.substring(printData.pzwh.length-8,printData.pzwh.length-4)+"】"+printData.pzwh.substring(printData.pzwh.length-4)+"号")));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("year","150.52mm","87.58mm","14.02mm","7.41mm",(printData.fzrq==null?"":(printData.fzrq).substring(0,4)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("month","150.52mm","103.19mm","7.94mm","7.41mm",(printData.fzrq==null?"":(printData.fzrq).substring(5,7)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("day","150.52mm","112.45mm","9mm","7.41mm",(printData.fzrq==null?"":(printData.fzrq).substring(5,7)));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("xkzh","45.61mm","47.18mm","43.13mm","6.09mm",(printData.xkzh==null?"":"  "+printData.xkzh.substring(0,printData.xkzh.indexOf('2'))+" "+printData.xkzh.substring(printData.xkzh.indexOf('2'))+"  号"));
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋_GB2312");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
        LODOP.SET_PRINT_STYLEA(0,"LetterSpacing","0.53mm");
        LODOP.ADD_PRINT_TEXTA("year","157.93mm","82.55mm","14.02mm","7.41mm","2018");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("month","157.93mm","98.43mm","7.94mm","7.41mm","10");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.ADD_PRINT_TEXTA("day","157.93mm","107.95mm","9mm","7.41mm","12");
        LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        //谷歌浏览器
        if (LODOP.CVERSION) {
            CLODOP.On_Return = function (TaskID, Value) {
                //打印状态
                printState = Value;
                if(printState >= 1) {
                    document.body.innerText="打印完成";
                    recordsGenerated(true);
                }else{
                    document.body.innerText="已取消打印";
                    recordsGenerated(false);
                }
            };
        }

        printState = LODOP.PRINT_DESIGN();
        //非谷歌
        if (!LODOP.CVERSION) {
            if(printState >= 1) {
                document.body.innerText="打印完成";
                recordsGenerated(true);
            }else{
                document.body.innerText="已取消打印";
                recordsGenerated(false);
            }
        }
    }
    function recordsGenerated(isPrint) {
        $.ajax({
            type: 'POST',
            url: host + "/manage/cer/recordsComGenerated",
            dataType: "json",
            data: {
                "id":printData.id,
                "isPrint":isPrint
            },
            success: function (json) {
                if (json.successful == true || json.successful == "true") {
                    console.log("更新打印状态成功！");
                } else {
                    console.log("更新打印状态失败！");
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                console && console.log(errorThrown);
            }
        });
    }
</script>
</html>
