일반 LODOP, 기록

2484 단어
/** */
            onPrint:function(){
                var LODOP =_methods.getLodop();
                if(LODOP){
                  LODOP.PRINT_INIT(" ");
                  LODOP.SET_PRINT_PAGESIZE(1,0,0,"A4");
                  LODOP.SET_PRINT_STYLEA(1,"Horient",2);
                }
                $.post(_ctx + "/print/printpage" + _suffix,null,function(html){    
                    LODOP.ADD_PRINT_HTM(15,0,"100%","100%",html);
                    LODOP.SET_PREVIEW_WINDOW(1,1,0,0,0," ");
                    LODOP.PREVIEW();                
                },"html")
            },
            getLodop :function() {
                var _lodop = $("object[data-id=lodop]");
                if (_lodop[0])
                    return _lodop[0];
                var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0);
                var is64IE = isIE && (navigator.userAgent.indexOf('x64') >= 0);
                _lodop = $("<object></object>").attr("data-id","lodop");
                _lodop.width(20).height(0).attr("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
                if (isIE){
                    _lodop.attr("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
                }else{
                    _lodop.attr("type", "application/x-print-lodop");
                }
                _lodop.prependTo("body");
                var LODOP = _lodop[0];
                var exe = is64IE ? "install_lodop64.exe" : "install_lodop32.exe";
                var href = _ctx + "/js/lib/lodop/6.1.9.0/" + exe;
                var alertstr = "<font color='#FF00FF'> <a href='" + href + "' target='_self'> </a>, 。</font>";
                if ((LODOP == null) || (typeof (LODOP.VERSION) == "undefined")) {
                    $.messager.alert(' ', " <br/>" + alertstr, 'warning');
                    return;
                } else if (LODOP.VERSION < "6.1.9.0") {
                    $.messager.alert(' ', " <br/>" + alertstr, 'info');
                }
                return LODOP;
            }

좋은 웹페이지 즐겨찾기