<%@page language="java" pageEncoding="utf-8" %> <link href="./css/styles_all.css" rel="stylesheet" type="text/css" /> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>打印</title> <script src='http://localhost:8000/CLodopfuncs.js'></script> <script language="javascript"> var LODOP; function printpreview() { // 打印页面预览 var strHTML=document.getElementsByTagName("html")[0].innerHTML; LODOP.PRINT_INITA(1,1,770,660,"测试预览功能"); LODOP.ADD_PRINT_HTM(30,5,"100%","80%",strHTML); LODOP.PREVIEW(); } </script> </head> <body> <div style="width:640px;height:20px;margin:100px auto 0 auto;font-size:12px;text-align:right;"> <input value="直接打印" type="button" onclick="javascript:window.print()" /> <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0> </object> <input type=button name=button_show value="打印预览" onclick="javascript:printpreview() ;"> <input type=button name=button_fh value="关闭" onclick="javascript:window.close();"> </div> <div style="width:640px;height:624px;margin:20px auto;"> </div> </body> </html>