1. //收费系统打印机功能:收费/退费,需要使用到lodop
  2. var LODOP;//打印机
  3. $(function () {
  4. //初始化
  5. $("body").append('<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed></object>');
  6.  
  7. LODOP = getLodop();
  8. });
  9.  
  10. //检测是否安装了打印插件
  11. function CheckLodop()
  12. {
  13. var oOBJECT = document.getElementById('LODOP_OB'), oEMBED = document.getElementById('LODOP_EM');
  14. var LODOP = oEMBED;
  15. try {
  16. var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0);
  17. var is64IE = isIE && (navigator.userAgent.indexOf('x64') >= 0);
  18. if (isIE) LODOP = oOBJECT;
  19. if ((LODOP == null) || (typeof (LODOP.VERSION) == "undefined")) {
  20. return false;
  21. } else
  22. if (LODOP.VERSION < "6.1.6.1") {
  23. return false;
  24. }
  25. return true;
  26. } catch (err) {
  27. return false;
  28. }
  29. }
  30.  
  31. function getLodop() {
  32. var oOBJECT = document.getElementById('LODOP_OB'), oEMBED = document.getElementById('LODOP_EM');
  33. /**************************
  34. 本函数根据浏览器类型决定采用哪个对象作为控件实例:
  35. IE系列、IE内核系列的浏览器采用oOBJECT,
  36. 其它浏览器(Firefox系列、Chrome系列、Opera系列、Safari系列等)采用oEMBED,
  37. 对于64位浏览器指向64位的安装程序install_lodop64.exe。
  38. **************************/
  39. var strHtmInstall = "打印控件未安装!点击这里<a href='/patch/install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。";
  40. var strHtmUpdate = "打印控件需要升级!点击这里<a href='/patch/install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。";
  41. var strHtm64_Install = "打印控件未安装!点击这里<a href='/patch/install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。";
  42. var strHtm64_Update = "打印控件需要升级!点击这里<a href='/patch/install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。";
  43. var strHtmFireFox = "注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它。";
  44. var LODOP = oEMBED;
  45. try {
  46. var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0);
  47. var is64IE = isIE && (navigator.userAgent.indexOf('x64') >= 0);
  48. var errhtml = '';
  49. if (isIE) LODOP = oOBJECT;
  50. if ((LODOP == null) || (typeof (LODOP.VERSION) == "undefined")) {
  51. if (navigator.userAgent.indexOf('Firefox') >= 0)
  52. {
  53. errhtml = strHtmFireFox
  54. }
  55. if (is64IE) {
  56. errhtml = strHtm64_Install;
  57. }
  58. else if (isIE) {
  59. errhtml = strHtmInstall;
  60. }
  61. else
  62. {
  63. errhtml = strHtmInstall;
  64. }
  65. ShowPrintErr(errhtml);
  66. return LODOP;
  67. } else {
  68. if (LODOP.VERSION < "6.1.6.1") {
  69. if (is64IE) {
  70. errhtml = strHtm64_Update;
  71. }
  72. else if (isIE) {
  73. errhtml = strHtmUpdate;
  74. }
  75. else {
  76. errhtml = strHtmUpdate;
  77. }
  78. ShowPrintErr(errhtml);
  79. return LODOP;
  80. }
  81. }
  82. //=====如下空白位置适合调用统一功能:=====
  83.  
  84. //=======================================
  85. return LODOP;
  86. } catch (err) {
  87. if (is64IE)
  88. {
  89. errhtml = "Error:" + strHtm64_Install;
  90. }
  91. else
  92. {
  93. errhtml = "Error:" + strHtmInstall;
  94. }
  95. ShowPrintErr(errhtml);
  96. return LODOP;
  97. }
  98. return LODOP;
  99. }
  100.  
  101. function ShowPrintErr(h)
  102. {
  103. if (h)
  104. {
  105. h = "<p>" + h;
  106. h += " <span id='az_close' style='cursor:pointer;display:inline-block;position:absolute;right:0;' title='点击关闭'>X</span></p>";
  107. $(".az_remind").html(h).fadeIn(2000);
  108. $("#az_close").click(function () {
  109. $(".az_remind").fadeOut(2000);
  110. });
  111. setTimeout(function () { $(".az_remind").fadeOut(2000); }, 5000);
  112. }
  113. }
  114.  
  115. (function ($) {
  116. function PrintBase(printObj) {
  117. this.nf = { FontName: '宋体', FontSize: 9 };
  118. this.hf = { FontName: '宋体', FontSize: 20 };
  119. this.printObj = printObj;
  120. this.printBegin = function () {
  121. LODOP.PRINT_INIT("票据" + Math.random());
  122. LODOP.SET_PRINTER_INDEXA(printObj.PrintSet.printerName);
  123. LODOP.SET_PRINT_MODE("POS_BASEON_PAPER", true);
  124. };
  125. this.DX = function (num) {
  126. var strOutput = "";
  127. var strUnit = '仟佰拾亿仟佰拾万仟佰拾元角分';
  128. num += "00";
  129. var intPos = num.indexOf('.');
  130. if (intPos >= 0)
  131. num = num.substring(0, intPos) + num.substr(intPos + 1, 2);
  132. strUnit = strUnit.substr(strUnit.length - num.length);
  133. for (var i = 0; i < num.length; i++)
  134. strOutput += '零壹贰叁肆伍陆柒捌玖'.substr(num.substr(i, 1), 1) + strUnit.substr(i, 1);
  135. return strOutput.replace(/零角零分$/, '整').replace(/零[仟佰拾]/g, '零').replace(/零{2,}/g, '零').replace(/零([亿|万])/g, '$1').replace(/零+元/, '元').replace(/亿零{0,3}万/, '亿').replace(/^元/, "零元");
  136. };
  137. this.printEnd = function () {
  138. LODOP.PRINT();
  139. };
  140. this.printFee = function () { };
  141. this.printFeeRefund = function () { };
  142. this.measureString = function (s, f) {
  143. //计算文字宽度
  144. return { width: s.length * f.FontSize, height: f.FontSize };
  145. }
  146. this.printLine = function (x1, y1, x2) {
  147. LODOP.ADD_PRINT_Line(y1, x1,y1, x2, 0, 1);
  148. };
  149. this.printString = function (s, f, x, y) {
  150. LODOP.ADD_PRINT_TEXT(y, x, 1000, 25, s);
  151. LODOP.SET_PRINT_STYLEA(0, "FontName", f.FontName);
  152. LODOP.SET_PRINT_STYLEA(0, "FontSize", f.FontSize);
  153. };
  154. }
  155. function PrinterPinA(printObj, printCopys, printCopysYAdd,y5,y6,y7,y8,y9) {
  156. PrintBase.call(this, printObj);
  157. this.maxCount = 12;
  158. this.currentPage = 1;
  159. this.xTitle = 370;
  160. this.yy = 25;
  161. this.x1 = 70;
  162. this.x2 = 200;
  163. this.x3 = 330;
  164. this.x4 = 460;
  165. this.x5 = 630;
  166. this.x6 = 727;
  167. this.y1 = 65;
  168. this.y2 = 80;
  169. this.y3 = 90;
  170. this.y4 = 115;
  171. this.y5 = y5;
  172. this.y6 = y6;
  173. this.y7 = y7;
  174. this.y8 = y8;
  175. this.y9 = y9;
  176. this.printCopys = printCopys;
  177. this.printCopysYAdd = printCopysYAdd;
  178. this.totalPages = Math.ceil(printObj.listFee.length / this.maxCount);
  179. this.printNormal = function (yAdd) {
  180. if (yAdd > 0) {
  181. this.printLine(0, yAdd, 900);
  182. }
  183. var title = this.printObj.schName + this.printObj.title;
  184.  
  185. //计算文字宽度
  186. var xTemp = (844 - this.measureString(title, this.hf).width) / 2;
  187. this.printString(title, this.hf, xTemp, this.yy + yAdd);
  188. this.printString("班级:" + this.printObj.clsName, this.nf, this.x1, this.y1 + yAdd);
  189. this.printString("姓名:" + this.printObj.userName, this.nf, this.x2, this.y1 + yAdd);
  190. this.printString("日期:" + this.printObj.payTime, this.nf, this.x4, this.y1 + yAdd);
  191. this.printString("单号:" + this.printObj.serialNum, this.nf, this.x5, this.y1 + yAdd);
  192. this.printLine(this.x1, this.y2 + yAdd, this.x6);
  193. this.printLine(this.x1, this.y6 + yAdd, this.x6);
  194. this.printString("合计:", this.nf, this.x1, this.y5 + yAdd);
  195. var printphoneX = this.x1;
  196. var printaddressY = this.y7;
  197. if (printObj.schName) {
  198. printphoneX = this.x2;
  199. printaddressY = this.y8;
  200. this.printString(printObj.schName, this.nf, this.x1, this.y7 + yAdd);
  201. }
  202. if (printObj.tel) {
  203. printaddressY = this.y8;
  204. this.printString("电话:" + printObj.tel, this.nf, printphoneX, this.y7 + yAdd);
  205. }
  206. if (printObj.printSeal) {
  207. printaddressY = this.y8;
  208. this.printString("盖章", this.nf, this.x5, this.y7 + yAdd);
  209. }
  210. if (printObj.schAddress) {
  211. this.printString("地址:" + printObj.schAddress, this.nf, this.x1, printaddressY + yAdd);
  212. }
  213. var fstr = "退款人";
  214. if (printObj.feeType==1) {
  215. fstr = "收款人";
  216. }
  217. fstr += ":" + printObj.payee;
  218. this.printString(fstr, this.nf, this.x5, printaddressY + yAdd);
  219. };
  220. this.printFee = function () {//打印收费
  221. this.printBegin();
  222. for (var i = 0; i < this.printCopys; i++) {
  223. var yAdd = i * this.printCopysYAdd;
  224. this.printNormal(yAdd);
  225. var total = 0, real = 0, qian = 0, discount = 0;
  226. var y = this.y4 + yAdd;
  227. this.printString("项目", this.nf, this.x1, this.y3 + yAdd);
  228. this.printString("应收金额(元)", this.nf, this.x2, this.y3 + yAdd);
  229. this.printString("实收金额(元)", this.nf, this.x3, this.y3 + yAdd);
  230. this.printString("备注", this.nf, this.x4, this.y3 + yAdd);
  231.  
  232. //遍历打印
  233. for (var j = (this.currentPage - 1) * this.maxCount; j < printObj.listFee.length && j < this.currentPage * this.maxCount; j++) {
  234. var temp = printObj.listFee[j];
  235. this.printString(temp.feeName, this.nf, this.x1, y);
  236. this.printString(temp.totalMoney.toFixed(2), this.nf, this.x2, y);
  237. this.printString(temp.realMoney.toFixed(2), this.nf, this.x3, y);
  238. this.printString(temp.payMsg, this.nf, this.x4, y);
  239.  
  240. total += temp.totalMoney;
  241. real += temp.realMoney;
  242. qian += temp.qianOldMoney;
  243. discount += temp.discountMoney;
  244. y += this.yy;
  245. }
  246.  
  247. this.printString("应收:" + total.toFixed(2) + "元", this.nf, this.x2, this.y5 + yAdd);
  248. this.printString("实收:" + real.toFixed(2) + "元", this.nf, this.x3, this.y5 + yAdd);
  249. this.printString("大写:" + this.DX(real), this.nf, this.x4, this.y5 + yAdd);
  250. if (qian) {
  251. this.printString("欠费:" + qian.toFixed(2) + "元", this.nf, this.x3, this.y9 + yAdd);
  252. }
  253. if (discount) {
  254. this.printString("减免:" + discount.toFixed(2) + "元", this.nf, this.x4, this.y9 + yAdd);
  255. }
  256. }
  257. this.printEnd();
  258. if (this.currentPage * this.maxCount < printObj.listFee.length) {
  259. this.currentPage++;
  260. this.printFee();
  261. }
  262. };
  263. this.printFeeRefund = function () {//打印退费
  264. this.printBegin();
  265. for (var i = 0; i < this.printCopys; i++) {
  266. var yAdd = i * this.printCopysYAdd;
  267. this.printNormal(yAdd);
  268. var real = 0;
  269. var y = this.y4 + yAdd;
  270. this.printString("退费项目", this.nf, this.x1, this.y3 + yAdd);
  271. this.printString("退费金额(元)", this.nf, this.x3, this.y3 + yAdd);
  272. this.printString("备注", this.nf, this.x4, this.y3 + yAdd);
  273.  
  274. //遍历打印
  275. for (var j = (this.currentPage - 1) * this.maxCount; j < printObj.listFee.length && j < this.currentPage * this.maxCount; j++) {
  276. var temp = printObj.listFee[j];
  277. this.printString(temp.feeName, this.nf, this.x1, y);
  278. this.printString(temp.realMoney.toFixed(2), this.nf, this.x3, y);
  279. this.printString(temp.payMsg, this.nf, this.x4, y);
  280.  
  281. real += temp.realMoney;
  282. y += this.yy;
  283. }
  284.  
  285. this.printString("退费:" + real.toFixed(2) + "元", this.nf, this.x3, this.y5 + yAdd);
  286. this.printString("大写:" + this.DX(real), this.nf, this.x4, this.y5 + yAdd);
  287. }
  288. this.printEnd();
  289. if (this.currentPage * this.maxCount < printObj.listFee.length) {
  290. this.currentPage++;
  291. this.printFee();
  292. }
  293. }
  294. }
  295.  
  296. function PrinterPin140(printObj) {//a4 2等分
  297. PrinterPinA.call(this, printObj, 1, -1, 415, 455, 465, 490, 440);
  298. }
  299.  
  300. function PrinterPinA4(printObj)//a4 双份
  301. {
  302. PrinterPinA.call(this, printObj, 2, 540, 415, 455, 465, 490, 440);
  303. }
  304. function PrinterPin93(printObj) {
  305. PrinterPinA.call(this, printObj, 1, -1, 265, 305, 310, 335, 290);
  306. }
  307. function PrinterTicket(printObj,x1,x2,x3,x4,totalWidth,hfSize,hf2Size,addrSize)
  308. {
  309. PrintBase.call(this, printObj);
  310. this.y = 5;
  311. this.x1 = x1;
  312. this.x2 = x2;
  313. this.x3 = x3;
  314. this.x4 = x4;
  315. this.yy = 15;
  316. this.yh = 20;
  317. this.yx = 10;
  318. this.totalWidth = totalWidth;
  319. this.addrSize = addrSize;
  320. this.hf = { FontName: '宋体', FontSize: hfSize };
  321. this.hf2 = { FontName: '宋体', FontSize: hf2Size };
  322. this.printFoot = function (total, qian, real, discount) {
  323. this.printLine(this.x1, this.y, this.totalWidth - this.x1);
  324. this.y += this.yx;
  325. this.printString("合计:" + printObj.listFee.length + "项", this.nf, this.x1, this.y);
  326. this.y += this.yy;
  327. if (printObj.feeType) {
  328. this.printString("应收:" + total.toFixed(2) + "元", this.nf, this.x1, this.y);
  329. this.y += this.yy;
  330. if (qian) {
  331. this.printString("欠费:" + qian.toFixed(2) + "元", this.nf, this.x1, this.y);
  332. this.y += this.yy;
  333. }
  334. if (discount) {
  335. this.printString("减免:" + discount.toFixed(2) + "元", this.nf, this.x1, this.y);
  336. this.y += this.yy;
  337. }
  338. this.printString("实收:" + real.toFixed(2) + "元", this.nf, this.x1, this.y);
  339. this.y += this.yy;
  340. } else {
  341. this.printString("退费:" + real.toFixed(2) + "元", this.nf, this.x1, this.y);
  342. this.y += this.yy;
  343. }
  344. this.printString("大写:" + this.DX(real), this.nf, this.x1, this.y);
  345. this.y += this.yy;
  346. var fstr = "退款人";
  347. if (printObj.feeType==1) {
  348. fstr = "收款人";
  349. }
  350. fstr += ":" + printObj.payee;
  351. this.printString(fstr, this.nf, this.x1, this.y);
  352. this.y += this.yy;
  353. if (printObj.tel || printObj.schAddress) {
  354. this.printLine(this.x1, this.y, (this.totalWidth - this.x1));
  355. this.y += this.yx;
  356. }
  357. if (printObj.tel) {
  358. this.printString("电话:" + printObj.tel, this.nf, this.x1, this.y);
  359. this.y += this.yy;
  360. }
  361. if (printObj.schAddress) {
  362. var add1 = printObj.schAddress;
  363. var add2 = '';
  364. //判断要打印的行数
  365. var rows = Math.ceil(add1.length / this.addrSize);
  366. for (var i = 0; i < rows; i++) {
  367. var end=(i+1)*this.addrSize;
  368. if(end>add1.length)end=add1.length;
  369. var temp = add1.substring(i * this.addrSize, end);
  370. if (i == 0) {
  371. this.printString("地址:" + temp, this.nf, this.x1, this.y);
  372. } else {
  373. this.printString(temp, this.nf, this.x1 * 8, this.y);
  374. }
  375. this.y += this.yy;
  376. }
  377. }
  378. };
  379. this.printHead = function () {
  380. if (printObj.schName) {
  381. var fs = this.measureString(printObj.schName, this.hf);
  382. var xtemp1 = (this.totalWidth - fs.width) / 2;
  383. this.printString(printObj.schName, this.hf, xtemp1, this.y);
  384. this.y += this.yh;
  385. }
  386. var f2 = this.measureString(printObj.title, this.hf2);
  387. var xtemp2 = (this.totalWidth - f2.width) / 2;
  388. this.printString(printObj.title, this.hf2, xtemp2, this.y);
  389. this.y += this.yh;
  390. this.printString("日期:" + printObj.payTime, this.nf, this.x1, this.y);
  391. this.printString("单号:" + printObj.serialNum, this.nf, this.x2, this.y);
  392. this.y += this.yy;
  393. this.printString("姓名:" + printObj.userName, this.nf, this.x1, this.y);
  394. this.printString("班级:" + printObj.clsName, this.nf, this.x2, this.y);
  395. this.y += this.yy;
  396. this.printLine(this.x1, this.y, this.totalWidth - this.x1);
  397. this.y += this.yx;
  398. };
  399. this.printFee = function () {//打印收费
  400. this.printBegin();
  401. this.printHead();
  402. var total = 0, real = 0, qian = 0, discount = 0;
  403. this.printString("项目", this.nf, this.x1, this.y);
  404. this.printString("应收(元)", this.nf, this.x3, this.y);
  405. this.printString("实收(元)", this.nf, this.x4, this.y);
  406. this.y += this.yy;
  407.  
  408. //遍历打印
  409. for (var j = 0; j < printObj.listFee.length; j++) {
  410. var temp = printObj.listFee[j];
  411. var name = temp.feeName;
  412. if(temp.payMsg)
  413. {
  414. name+='(' + temp.payMsg + ')';
  415. }
  416. this.printString(name,this.nf, this.x1, this.y);
  417. this.y+=this.yy;
  418. this.printString(temp.totalMoney.toFixed(2), this.nf, this.x3, this.y);
  419. this.printString(temp.realMoney.toFixed(2), this.nf, this.x4, this.y);
  420. total += temp.totalMoney;
  421. real += temp.realMoney;
  422. qian += temp.qianOldMoney;
  423. discount += temp.discountMoney;
  424. this.y += this.yy;
  425. }
  426.  
  427. this.printFoot(total, qian, real, discount);
  428. this.printEnd();
  429. };
  430. this.printFeeRefund = function () {//打印退费
  431. this.printBegin();
  432. this.printHead();
  433. var real = 0;
  434. this.printString("项目", this.nf, this.x1, this.y);
  435. this.printString("退费(元)", this.nf, this.x4, this.y);
  436. this.y += this.yy;
  437.  
  438. //遍历打印
  439. for (var j = 0; j < printObj.listFee.length ; j++) {
  440. var temp = printObj.listFee[j];
  441. var name = temp.feeName;
  442. if (temp.payMsg) {
  443. name += '(' + temp.payMsg + ')';
  444. }
  445. this.printString(name, this.nf, this.x1, this.y);
  446. this.y += this.yy;
  447. this.printString(temp.realMoney.toFixed(2), this.nf, this.x4, this.y);
  448. real += temp.realMoney;
  449. this.y += this.yy;
  450. }
  451. this.printFoot(0, 0, real, 0);
  452. this.printEnd();
  453. };
  454. }
  455. function PrinterTicket80(printObj) {
  456. PrinterTicket.call(this, printObj, 5, 180, 120, 200, 280, 12, 10,20);
  457. }
  458. function PrinterTicket76(printObj) {
  459. PrinterTicket.call(this, printObj, 5, 155, 105, 185, 266, 12, 10,18);
  460. }
  461. function PrinterTicket50(printObj) {
  462. PrinterTicket.call(this, printObj, 5, 180, 60, 120, 192, 10, 8,11);
  463. this.printHead = function () {
  464. if (printObj.schName) {
  465. var fs = this.measureString(printObj.schName, this.hf);
  466. var xtemp1 = (this.totalWidth - fs.width) / 2;
  467. this.printString(printObj.schName, this.hf, xtemp1, this.y);
  468. this.y += this.yh;
  469. }
  470. var f2 = this.measureString(printObj.title, this.hf2);
  471. var xtemp2 = (this.totalWidth - f2.width) / 2;
  472. this.printString(printObj.title, this.hf2, xtemp2, this.y);
  473. this.y += this.yh;
  474. this.printString("日期:" + printObj.payTime, this.nf, this.x1, this.y);
  475. this.y += this.yy;
  476. this.printString("单号:" + printObj.serialNum, this.nf, this.x1, this.y);
  477. this.y += this.yy;
  478. this.printString("班级:" + printObj.clsName, this.nf, this.x1, this.y);
  479. this.y += this.yy;
  480. this.printString("姓名:" + printObj.userName, this.nf, this.x1, this.y);
  481. this.y += this.yy;
  482. this.printLine(this.x1, this.y, this.totalWidth - this.x1);
  483. this.y += this.yx;
  484. };
  485. }
  486. $.extend({
  487. Print: function (printObj) {
  488. if (printObj.PrintSet.printerName) {
  489. var pt;
  490. switch (printObj.PrintSet.printerType) {
  491. case 1:
  492. pt = new PrinterPin140(printObj);
  493. break;
  494. case 2:
  495. pt = new PrinterPin93(printObj);
  496. break;
  497. case 3:
  498. pt = new PrinterTicket80(printObj);
  499. break;
  500. case 4:
  501. pt = new PrinterTicket76(printObj);
  502. break;
  503. case 5:
  504. pt = new PrinterTicket50(printObj);
  505. break;
  506. case 6:
  507. pt = new PrinterPinA4(printObj);
  508. break;
  509. }
  510. if (pt) {
  511. var k = 0;
  512. var si = setInterval(function () {
  513. if (k < printObj.PrintSet.printNumber) {
  514. k++;
  515. if (printObj.feeType == 1) {
  516. pt.printFee(printObj);
  517. } else {
  518. pt.printFeeRefund(printObj);
  519. }
  520. }
  521. else
  522. {
  523. clearInterval(si);
  524. }
  525. }, 200);
  526. }
  527. }
  528. }
  529. });
  530. })(jQuery);

lodop打印收费小票的更多相关文章

  1. [原创]Lodop打印, 以及Lodop引用css文件控制打印样式的问题.

    最近在做Lodop打印功能: 思路是:  用MasterPage搭个打印页面的框架, 然后在具体的页面中填入数据, 打印的样式由母版页和CSS来控制. 困扰了一天的问题是:  在打印的JS文件中, 引 ...

  2. chrome升级后LODOP打印插件无法使用

    今天帮朋友使用LODOP实现一个套打程序时,发现LODOP打印插件在chrome下始终无法使用.分析后发现是自己才升级了chrome,chrome新版默认是禁用npapi的,因此需要手动启用一下,启用 ...

  3. LODOP打印控件示例

    一.lodop打印预览效果图 LODOP.PRINT_SETUP();打印维护效果图 LODOP.PREVIEW();打印预览图 二.写在前面 最近项目用到了LODOP的套打,主要用到两个地方,一是物 ...

  4. LODOP打印当前日期时间的方法

    JS方法直接获取.之前有个详细介绍的博文:LODOP打印用JS获取的当前日期本文也再演示一下,详细介绍见上面链接的博文,该方法此文不做详细介绍. 本文有三段:1.JS获取日期,2,.LODOP的FOR ...

  5. LODOP打印用JS获取的当前日期

    该文详细一步步解释JS获取当前时间的方法,新手小白也看到懂,最后是实际的获取当前年月份的方法.JS中的Date()对象,包含很多当前系统时间的方法,首先建立一个Date()对象,这里取名为date,然 ...

  6. Lodop打印控件在页面如何使用

    Lodop打印控件部署到web服务器简单,在页面的使用方法也简单,是非常容易和方便使用的打印控件.客户端本地打印角色(即用户访问网站后 用自己链接的打印机进行客户端本地打印),步骤很少,部署简单:Lo ...

  7. Lodop打印表格带页头页尾 自动分页每页显示头尾

    Lodop中有两种专门给超文本表格的方式,ADD_PRINT_TABLE和ADD_PRINT_TBURL,该方式只能用于单个表格,表格外的内容不显示,是专门用于打印html超文本表格的.使用这两个语句 ...

  8. Lodop打印表格带页头页尾 高度是否包含页头页尾

    通过设置TableHeightScope,可以实现对ADD_PRINT_TABLE,表格带页头页尾,查看本博客另一篇博文:Lodop打印表格带页头页尾 自动分页每页显示头尾 超文本超过打印项高度,会自 ...

  9. Lodop打印控件传入css样式、看是否传入正确样式

    Lodop中可以传入页面存在的css样式,也可以是拼接后的新样式,例如本博客的其他博文:Lodop打印如何隐藏table某一列 需要打印的页面,样式不一定都是行内样式,style样式单独写在页面上,或 ...

随机推荐

  1. maven入门(9)Maven常用命令

    Maven常用命令 清理 clean编译 compile打包 package安装 install跳过测试 clean package -Dmaven.test.skip=true

  2. NHibernate与IbatisNet的简单比较

    NHibernate是当前最流行的Java O/R mapping框架Hibernate的移植版本,当前版本是1.0 rc-1.它出身于sf.net..IbatisNet是另外一种优秀的Java O/ ...

  3. 转:swing 中paint与paintComponent的区别(jcomponent)

    http://blog.csdn.net/q597756870/article/details/17854247 查API文档,查得在类Jcomponent下的paint方法有以下解释:        ...

  4. ehcache.xml 属性大全

    属性大全 name:缓存名称. maxElementsInMemory:缓存最大个数. eternal:对象是否永久有效,一但设置了,timeout将不起作用. timeToIdleSeconds:设 ...

  5. 微信小程序:wx.request之post请求后端无法获取数据的问题

    前言:小程序的开发中总是踩到各种坑,看文档也不知所云: 例如当我们在写微信小程序接口时,method请求方式有POST和GET两种,为了数据安全,我们会偏向于使用POST请求方式访问服务器端: 问题: ...

  6. Spring Cloud学习笔记-002

    搭建Spring Cloud注册中心:Eureka 服务注册:在服务治理框架中,通常都会构建一个注册中心,每个服务单元向注册中心登记自己提供的服务,将主机与端口号.版本号.通信协议等一些附加信息告诉注 ...

  7. Hibernate注解用法

    @NotNull 适用于基本类型,任何对象的value不能为null. @NotBlank 适用于String类型,只能用于字符串不为null,并且字符串trim()以后length要大于0 @Not ...

  8. 自动化运维:使用flask+mysql+highcharts搭建监控平台

    1.前言 本来想做一个比较完善的监控平台,只需要做少许改动就可以直接拿来用,但是在做的过程中发现要实现这个目标所需的工作量太大,而当前的工作中对其需求又不是特别明显.所以就退而求其次,做了一个类似教程 ...

  9. 小工具:批量导入导出主机上的docker镜像

    工作需要,将主机上的部分镜像导出为tar文件,放便在其他主机上使用 用python实现了一个批量打包脚本: import re import os import subprocess if __nam ...

  10. Tab标签js切换高效率写法

    原来的传统写法: function tabit(id,cid) { for(var i=0; i<10; i++){ gi(["tab"+i]).className = &q ...