PrintSample1.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>WEB打印控件LODOP的样例一:在页面内引入打印控件</title>
  6. <script language="javascript" src="LodopFuncs.js"></script>
  7. </head>
  8. <body>
  9. <table cellpadding="0" cellspacing="0" border="0" width="78%" height="152">
  10. <tr>
  11. <td width="100%" height="20"><h2><font color="#009999">演示如何在页面内引入打印控件Lodop:</font></h2></td>
  12. </tr>
  13. <tr>
  14. <td width="100%" height="5"></td>
  15. </tr>
  16. <tr>
  17. <td width="100%" height="20"><b><font size="3" face="黑体">一、嵌入方式:</font></b></td>
  18. </tr>
  19. <tr>
  20. <td width="100%" height="20">
  21. <font>&nbsp;通常情况下,在页面中嵌入Lodop如下引用代码,然后用一个全局对象变量来使用控件:</font></td>
  22. </tr>
  23. <tr>
  24. <td width="100%" height="20">·在head或body中加入:</td>
  25. </tr>
  26. <tr>
  27. <td width="100%" height="20"><font size="2" color="#0000FF" >&lt;script
  28. src=&quot;LodopFuncs.js&quot;&gt;&lt;/script&gt;</font></td>
  29. </tr>
  30. <tr>
  31. <td width="100%" height="20"><font size="2" color="#0000FF" >&lt;object&nbsp;
  32. id=&quot;LODOP_OB&quot; classid=&quot;clsid:2105C259-1E0C-4534-8141-A753534CB4CA&quot;
  33. width=0 height=0&gt;&nbsp;</font></td>
  34. </tr>
  35. <tr>
  36. <td width="100%" height="20"><font size="2" color="#0000FF" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  37. &lt;embed id=&quot;LODOP_EM&quot; type=&quot;application/x-print-lodop&quot;
  38. width=0 height=0&gt;&lt;/embed&gt;</font></td>
  39. </tr>
  40. <tr>
  41. <td width="100%" height="20"><font size="2" color="#0000FF" >&lt;/object&gt;</font></td>
  42. </tr>
  43. <tr>
  44. <td width="100%" height="20"><font >·在调用Lodop功能前,先用如下JS过程获得控件对象:</font></td>
  45. </tr>
  46. <tr>
  47. <td width="100%" height="20"><font color="#0000FF" size="2" >&nbsp;&nbsp;&nbsp;
  48. var </font><font color="#0000FF" size="2">LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));</font></td>
  49. </tr>
  50. <tr>
  51. <td width="100%" height="20">·现在测试一下:<a href="javascript:CheckIsInstall()">查看本机是否安装(控件或web打印服务)</a></td>
  52. </tr>
  53. <tr>
  54. <td width="100%" height="20">·当页面不添加以上代码时,getLodop过程会动态建立它们,语句简化如下(推荐):</td>
  55. </tr>
  56. <tr>
  57. <td width="100%" height="20"><font color="#0000FF" size="2" >&nbsp;&nbsp;&nbsp;var LODOP=getLodop();</font></td>
  58. </tr>
  59. <tr>
  60. <td width="100%" height="20">·如果仅部署C-Lodop则更简单,以上所有代码都省略,只加如下一句:</td>
  61. </tr>
  62. <tr>
  63. <td width="100%" height="20">&nbsp;&nbsp;&nbsp;&nbsp;<font size="2" color="#0000FF" >&lt;script
  64. src=&quot;http://localhost:8000/CLodopFuncs.js&quot;&gt;&lt;/script&gt;</font></td>
  65. </tr>
  66. <tr>
  67. <td width="100%" height="10"></td>
  68. </tr>
  69. <tr>
  70. <td width="100%" height="20"><b><font size="3" face="黑体">二、相关文件:</font></b>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td width="100%" height="20"><font color="#0000FF">·install_lodop32.exe和install_lodop64.exe</font></td>
  75. </tr>
  76. <tr>
  77. <td width="100%" height="20">&nbsp;&nbsp;&nbsp;
  78. 这俩文件是安装和升级Lodop控件的主程序,对应32位和64位浏览器(注意浏览器位数不是操作系统位数)</td>
  79. </tr>
  80. <tr>
  81. <td width="100%" height="20">&nbsp;&nbsp;&nbsp; 提供给用户下载后使用,如果将它们复制或改名为<font color="#0000FF">uninstall_lodop32.exe</font>(名前加un)就可用其卸载控件。</td>
  82. </tr>
  83. <tr>
  84. <td width="100%" height="20"><font color="#0000FF">·CLodop_Setup_for_Win32NT.exe</font></td>
  85. </tr>
  86. <tr>
  87. <td width="100%" height="20">&nbsp;&nbsp;&nbsp;
  88. 这是web打印服务C-Lodop标准版安装主程序,它是个JS服务(内含Lodop),适合所有浏览器,可替代前者。</td>
  89. </tr>
  90. <tr>
  91. <td width="100%" height="20"><font color="#0000FF">·LodopFuncs.js</font></td>
  92. </tr>
  93. <tr>
  94. <td width="100%" height="20">&nbsp;&nbsp;&nbsp;
  95. 该文件是个样例(很简单尽量看懂它),其中的<span LANG="ZH"><font color="#0000FF">getLodop</font></span>过程根据浏览器类型检查是否安装、是否最新版本,</td>
  96. </tr>
  97. <tr>
  98. <td width="100%" height="20">&nbsp;&nbsp;&nbsp; 然后引导用户对应下载执行install_lodopXX.exe文件或CLodop_Setup_for_Win32NT.exe。</td>
  99. </tr>
  100. <tr>
  101. <td width="100%" height="20"><font color="#0000FF">·实体文件</font></td>
  102. </tr>
  103. <tr>
  104. <td width="100%" height="20">&nbsp;&nbsp;&nbsp; Lodop控件被安装后,其实体文件<font color="#0000FF">CAOSOFT_WEB_PRINT_LODOP.OCX</font>和<font color="#0000FF">NPCAOSOFT_WEB_PRINT_lodop.dll</font></td>
  105. </tr>
  106. <tr>
  107. <td width="100%" height="20">&nbsp;&nbsp;&nbsp; 被安装在系统Program Files\MountTaiSoftware\Lodop目录下,而C-Lodop实体被安装在:</td>
  108. </tr>
  109. <tr>
  110. <td width="100%" height="20">&nbsp;&nbsp;&nbsp; Program Files\MountTaiSoftware\CLodop32下,其中<font color="#0000FF">CLodopPrint32.exe</font>是主服务程序。</td>
  111. </tr>
  112. <tr>
  113. <td width="100%" height="10"></td>
  114. </tr>
  115. <tr>
  116. <td width="100%" height="20"><b><font size="3" face="黑体">三、支持的浏览器:</font></b>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td width="100%" height="20">目前支持<font color="#0000FF">IE系列、IE内核系列</font>(QQ、搜狗、UC、360等外壳)浏览器,以及<font color="#0000FF">Chrome</font>(谷歌)系列、</td>
  121. </tr>
  122. <tr>
  123. <td width="100%" height="20"><font color="#0000FF">Firefox</font>(火狐)系列、<font color="#0000FF">Opera</font>系列、
  124. <font color="#0000FF">Safari</font>系列等各种浏览器的几乎所有版本。</td>
  125. </tr>
  126. </table>
  127. <script language="javascript" type="text/javascript">
  128. function CheckIsInstall() {
  129. try{
  130. var LODOP=getLodop();
  131. if (LODOP.VERSION) {
  132. if (LODOP.CVERSION)
  133. alert("当前有WEB打印服务C-Lodop可用!\n C-Lodop版本:"+LODOP.CVERSION+"(内含Lodop"+LODOP.VERSION+")");
  134. else
  135. alert("本机已成功安装了Lodop控件!\n 版本号:"+LODOP.VERSION);
  136. };
  137. }catch(err){
  138. }
  139. };
  140. </script>
  141. <p><a href="PrintSampIndex.html">&lt;&lt;回样例目录</a></p>
  142. </body>
  143. </html>