custom-print-json.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. var customPrintJson = {
  2. "panels": [{
  3. "index": 0,
  4. "height": 297,
  5. "width": 210,
  6. "paperHeader": 49.5,
  7. "paperFooter": 780,
  8. "printElements": [{
  9. "options": {
  10. "left": 175.5,
  11. "top": 10.5,
  12. "height": 27,
  13. "width": 259,
  14. "title": "HiPrint自定义模块打印插件",
  15. "fontSize": 19,
  16. "fontWeight": "600",
  17. "textAlign": "center",
  18. "lineHeight": 26
  19. },
  20. "printElementType": {
  21. "title": "自定义文本",
  22. "type": "text"
  23. }
  24. }, {
  25. "options": {
  26. "left": 60,
  27. "top": 27,
  28. "height": 13,
  29. "width": 52,
  30. "title": "页眉线",
  31. "textAlign": "center"
  32. },
  33. "printElementType": {
  34. "title": "自定义文本",
  35. "type": "text"
  36. }
  37. }, {
  38. "options": {
  39. "left": 25.5,
  40. "top": 57,
  41. "height": 705,
  42. "width": 9,
  43. "fixed": true,
  44. "borderStyle": "dotted"
  45. },
  46. "printElementType": {
  47. "type": "vline"
  48. }
  49. }, {
  50. "options": {
  51. "left": 60,
  52. "top": 61.5,
  53. "height": 48,
  54. "width": 87,
  55. "src": "/Content/assets/hi.png"
  56. },
  57. "printElementType": {
  58. "title": "图片",
  59. "type": "image"
  60. }
  61. }, {
  62. "options": {
  63. "left": 153,
  64. "top": 64.5,
  65. "height": 39,
  66. "width": 276,
  67. "title": "二维码以及条形码均采用svg格式打印。不同打印机打印不会造成失真。图片打印:不同DPI打印可能会导致失真,",
  68. "fontFamily": "微软雅黑",
  69. "textAlign": "center",
  70. "lineHeight": 18
  71. },
  72. "printElementType": {
  73. "title": "自定义文本",
  74. "type": "text"
  75. }
  76. }, {
  77. "options": {
  78. "left": 457.5,
  79. "top": 79.5,
  80. "height": 13,
  81. "width": 120,
  82. "title": "姓名",
  83. "field": "name",
  84. "testData": "古力娜扎",
  85. "color": "#f00808",
  86. "textDecoration": "underline",
  87. "textAlign": "center"
  88. },
  89. "printElementType": {
  90. "title": "文本",
  91. "type": "text"
  92. }
  93. }, {
  94. "options": {
  95. "left": 499.5,
  96. "top": 120,
  97. "height": 43,
  98. "width": 51,
  99. "title": "123456789",
  100. "textType": "qrcode"
  101. },
  102. "printElementType": {
  103. "title": "自定义文本",
  104. "type": "text"
  105. }
  106. }, {
  107. "options": {
  108. "left": 285,
  109. "top": 130.5,
  110. "height": 34,
  111. "width": 175,
  112. "title": "123456789",
  113. "fontFamily": "微软雅黑",
  114. "textAlign": "center",
  115. "textType": "barcode"
  116. },
  117. "printElementType": {
  118. "title": "自定义文本",
  119. "type": "text"
  120. }
  121. }, {
  122. "options": {
  123. "left": 60,
  124. "top": 132,
  125. "height": 19,
  126. "width": 213,
  127. "title": "所有打印元素都可已拖拽的方式来改变元素大小",
  128. "fontFamily": "微软雅黑",
  129. "textAlign": "center",
  130. "lineHeight": 18
  131. },
  132. "printElementType": {
  133. "title": "自定义文本",
  134. "type": "text"
  135. }
  136. }, {
  137. "options": {
  138. "left": 153,
  139. "top": 189,
  140. "height": 13,
  141. "width": 238,
  142. "title": "单击元素,右侧可自定义元素属性",
  143. "textAlign": "center",
  144. "fontFamily": "微软雅黑"
  145. },
  146. "printElementType": {
  147. "title": "自定义文本",
  148. "type": "text"
  149. }
  150. }, {
  151. "options": {
  152. "left": 60,
  153. "top": 190.5,
  154. "height": 13,
  155. "width": 51,
  156. "title": "横线",
  157. "textAlign": "center"
  158. },
  159. "printElementType": {
  160. "title": "自定义文本",
  161. "type": "text"
  162. }
  163. }, {
  164. "options": {
  165. "left": 415.5,
  166. "top": 190.5,
  167. "height": 13,
  168. "width": 164,
  169. "title": "可以配置各属性的默认值",
  170. "textAlign": "center",
  171. "fontFamily": "微软雅黑"
  172. },
  173. "printElementType": {
  174. "title": "自定义文本",
  175. "type": "text"
  176. }
  177. }, {
  178. "options": {
  179. "left": 60,
  180. "top": 214.5,
  181. "height": 10,
  182. "width": 475.5
  183. },
  184. "printElementType": {
  185. "title": "横线",
  186. "type": "hline"
  187. }
  188. }, {
  189. "options": {
  190. "left": 235.5,
  191. "top": 220.5,
  192. "height": 32,
  193. "width": 342,
  194. "title": "自定义表格:用户可左键选中表头,右键查看可操作项,操作类似Excel,双击表头单元格可进行编辑。内容:title#field",
  195. "fontFamily": "微软雅黑",
  196. "textAlign": "center",
  197. "lineHeight": 15
  198. },
  199. "printElementType": {
  200. "title": "自定义文本",
  201. "type": "text"
  202. }
  203. }, {
  204. "options": {
  205. "left": 156,
  206. "top": 265.5,
  207. "height": 13,
  208. "width": 94,
  209. "title": "表头列大小可拖动",
  210. "fontFamily": "微软雅黑",
  211. "textAlign": "center"
  212. },
  213. "printElementType": {
  214. "title": "自定义文本",
  215. "type": "text"
  216. }
  217. }, {
  218. "options": {
  219. "left": 60,
  220. "top": 265.5,
  221. "height": 13,
  222. "width": 90,
  223. "title": "红色区域可拖动",
  224. "fontFamily": "微软雅黑",
  225. "textAlign": "center"
  226. },
  227. "printElementType": {
  228. "title": "自定义文本",
  229. "type": "text"
  230. }
  231. }, {
  232. "options": {
  233. "left": 60,
  234. "top": 285,
  235. "height": 44,
  236. "width": 511.5,
  237. "field": "table",
  238. "columns": [
  239. [{
  240. "width": 85.25,
  241. "colspan": 1,
  242. "rowspan": 1
  243. }, {
  244. "width": 85.25,
  245. "colspan": 1,
  246. "rowspan": 1
  247. }, {
  248. "title": "姓名",
  249. "field": "name",
  250. "width": 85.25,
  251. "align": "center",
  252. "colspan": 1,
  253. "rowspan": 1
  254. }, {
  255. "width": 85.25,
  256. "colspan": 1,
  257. "rowspan": 1
  258. }, {
  259. "width": 85.25,
  260. "colspan": 1,
  261. "rowspan": 1
  262. }, {
  263. "width": 85.25,
  264. "colspan": 1,
  265. "rowspan": 1
  266. }]
  267. ]
  268. },
  269. "printElementType": {
  270. "title": "表格",
  271. "type": "tableCustom",
  272. "footerFormatter":function(options,rows,data,currentPageGridRowsData){
  273. return "<tr><td>"+currentPageGridRowsData.length+"</td></tr>"
  274. }
  275. }
  276. }, {
  277. "options": {
  278. "left": 21,
  279. "top": 346.5,
  280. "height": 61.5,
  281. "width": 15,
  282. "title": "装订线",
  283. "lineHeight": 18,
  284. "fixed": true,
  285. "contentPaddingTop": 3.75,
  286. "backgroundColor": "#ffffff"
  287. },
  288. "printElementType": {
  289. "type": "text"
  290. }
  291. }, {
  292. "options": {
  293. "left": 225,
  294. "top": 349.5,
  295. "height": 13,
  296. "width": 346.5,
  297. "title": "自定义模块:主要为开发人员设计,能够快速,简单,实现自己功能",
  298. "textAlign": "center"
  299. },
  300. "printElementType": {
  301. "title": "自定义文本",
  302. "type": "text"
  303. }
  304. }, {
  305. "options": {
  306. "left": 60,
  307. "top": 370.5,
  308. "height": 18,
  309. "width": 79,
  310. "title": "配置项表格",
  311. "textAlign": "center"
  312. },
  313. "printElementType": {
  314. "title": "自定义文本",
  315. "type": "text"
  316. }
  317. }, {
  318. "options": {
  319. "left": 225,
  320. "top": 385.5,
  321. "height": 38,
  322. "width": 346.5,
  323. "title": "配置模块:主要为客户使用,开发人员可以配置属性,字段,标题等,客户直接使用,配置模块请参考实例2",
  324. "fontFamily": "微软雅黑",
  325. "lineHeight": 15,
  326. "textAlign": "center",
  327. "color": "#d93838"
  328. },
  329. "printElementType": {
  330. "title": "自定义文本",
  331. "type": "text"
  332. }
  333. }, {
  334. "options": {
  335. "left": 60,
  336. "top": 487.5,
  337. "height": 13,
  338. "width": 123,
  339. "title": "长文本会自动分页",
  340. "textAlign": "center"
  341. },
  342. "printElementType": {
  343. "title": "自定义文本",
  344. "type": "text"
  345. }
  346. }, {
  347. "options": {
  348. "left": 60,
  349. "top": 507,
  350. "height": 40,
  351. "width": 511.5,
  352. "field": "longText"
  353. },
  354. "printElementType": {
  355. "title": "长文",
  356. "type": "longText"
  357. }
  358. }, {
  359. "options": {
  360. "left": 475.5,
  361. "top": 565.5,
  362. "height": 100,
  363. "width": 100
  364. },
  365. "printElementType": {
  366. "title": "矩形",
  367. "type": "rect"
  368. }
  369. }, {
  370. "options": {
  371. "left": 174,
  372. "top": 568.5,
  373. "height": 13,
  374. "width": 90,
  375. "title": "竖线",
  376. "textAlign": "center"
  377. },
  378. "printElementType": {
  379. "title": "自定义文本",
  380. "type": "text"
  381. }
  382. }, {
  383. "options": {
  384. "left": 60,
  385. "top": 574.5,
  386. "height": 100,
  387. "width": 10
  388. },
  389. "printElementType": {
  390. "title": "竖线",
  391. "type": "vline"
  392. }
  393. }, {
  394. "options": {
  395. "left": 210,
  396. "top": 604.5,
  397. "height": 13,
  398. "width": 120,
  399. "title": "横线",
  400. "textAlign": "center"
  401. },
  402. "printElementType": {
  403. "title": "自定义文本",
  404. "type": "text"
  405. }
  406. }, {
  407. "options": {
  408. "left": 130.5,
  409. "top": 625.5,
  410. "height": 10,
  411. "width": 277
  412. },
  413. "printElementType": {
  414. "title": "横线",
  415. "type": "hline"
  416. }
  417. }, {
  418. "options": {
  419. "left": 364.5,
  420. "top": 649.5,
  421. "height": 13,
  422. "width": 101,
  423. "title": "矩形",
  424. "textAlign": "center"
  425. },
  426. "printElementType": {
  427. "title": "自定义文本",
  428. "type": "text"
  429. }
  430. }, {
  431. "options": {
  432. "left": 525,
  433. "top": 784.5,
  434. "height": 13,
  435. "width": 63,
  436. "title": "页尾线",
  437. "textAlign": "center"
  438. },
  439. "printElementType": {
  440. "title": "自定义文本",
  441. "type": "text"
  442. }
  443. }, {
  444. "options": {
  445. "left": 12,
  446. "top": 786,
  447. "height": 49,
  448. "width": 49
  449. },
  450. "printElementType": {
  451. "title": "html",
  452. "type": "html"
  453. }
  454. }, {
  455. "options": {
  456. "left": 75,
  457. "top": 790.5,
  458. "height": 13,
  459. "width": 137,
  460. "title": "红色原型是自动定义的Html",
  461. "textAlign": "center"
  462. },
  463. "printElementType": {
  464. "title": "自定义文本",
  465. "type": "text"
  466. }
  467. }, {
  468. "options": {
  469. "left": 334.5,
  470. "top": 810,
  471. "height": 13,
  472. "width": 205,
  473. "title": "页眉线已上。页尾下以下每页都会重复打印",
  474. "textAlign": "center"
  475. },
  476. "printElementType": {
  477. "title": "自定义文本",
  478. "type": "text"
  479. }
  480. }],
  481. "paperNumberLeft": 565.5,
  482. "paperNumberTop": 819
  483. }]
  484. }