custom-print-json.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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. }
  273. }, {
  274. "options": {
  275. "left": 21,
  276. "top": 346.5,
  277. "height": 61.5,
  278. "width": 15,
  279. "title": "装订线",
  280. "lineHeight": 18,
  281. "fixed": true,
  282. "contentPaddingTop": 3.75,
  283. "backgroundColor": "#ffffff"
  284. },
  285. "printElementType": {
  286. "type": "text"
  287. }
  288. }, {
  289. "options": {
  290. "left": 225,
  291. "top": 349.5,
  292. "height": 13,
  293. "width": 346.5,
  294. "title": "自定义模块:主要为开发人员设计,能够快速,简单,实现自己功能",
  295. "textAlign": "center"
  296. },
  297. "printElementType": {
  298. "title": "自定义文本",
  299. "type": "text"
  300. }
  301. }, {
  302. "options": {
  303. "left": 60,
  304. "top": 370.5,
  305. "height": 18,
  306. "width": 79,
  307. "title": "配置项表格",
  308. "textAlign": "center"
  309. },
  310. "printElementType": {
  311. "title": "自定义文本",
  312. "type": "text"
  313. }
  314. }, {
  315. "options": {
  316. "left": 225,
  317. "top": 385.5,
  318. "height": 38,
  319. "width": 346.5,
  320. "title": "配置模块:主要为客户使用,开发人员可以配置属性,字段,标题等,客户直接使用,配置模块请参考实例2",
  321. "fontFamily": "微软雅黑",
  322. "lineHeight": 15,
  323. "textAlign": "center",
  324. "color": "#d93838"
  325. },
  326. "printElementType": {
  327. "title": "自定义文本",
  328. "type": "text"
  329. }
  330. }, {
  331. "options": {
  332. "left": 60,
  333. "top": 487.5,
  334. "height": 13,
  335. "width": 123,
  336. "title": "长文本会自动分页",
  337. "textAlign": "center"
  338. },
  339. "printElementType": {
  340. "title": "自定义文本",
  341. "type": "text"
  342. }
  343. }, {
  344. "options": {
  345. "left": 60,
  346. "top": 507,
  347. "height": 40,
  348. "width": 511.5,
  349. "field": "longText"
  350. },
  351. "printElementType": {
  352. "title": "长文",
  353. "type": "longText"
  354. }
  355. }, {
  356. "options": {
  357. "left": 475.5,
  358. "top": 565.5,
  359. "height": 100,
  360. "width": 100
  361. },
  362. "printElementType": {
  363. "title": "矩形",
  364. "type": "rect"
  365. }
  366. }, {
  367. "options": {
  368. "left": 174,
  369. "top": 568.5,
  370. "height": 13,
  371. "width": 90,
  372. "title": "竖线",
  373. "textAlign": "center"
  374. },
  375. "printElementType": {
  376. "title": "自定义文本",
  377. "type": "text"
  378. }
  379. }, {
  380. "options": {
  381. "left": 60,
  382. "top": 574.5,
  383. "height": 100,
  384. "width": 10
  385. },
  386. "printElementType": {
  387. "title": "竖线",
  388. "type": "vline"
  389. }
  390. }, {
  391. "options": {
  392. "left": 210,
  393. "top": 604.5,
  394. "height": 13,
  395. "width": 120,
  396. "title": "横线",
  397. "textAlign": "center"
  398. },
  399. "printElementType": {
  400. "title": "自定义文本",
  401. "type": "text"
  402. }
  403. }, {
  404. "options": {
  405. "left": 130.5,
  406. "top": 625.5,
  407. "height": 10,
  408. "width": 277
  409. },
  410. "printElementType": {
  411. "title": "横线",
  412. "type": "hline"
  413. }
  414. }, {
  415. "options": {
  416. "left": 364.5,
  417. "top": 649.5,
  418. "height": 13,
  419. "width": 101,
  420. "title": "矩形",
  421. "textAlign": "center"
  422. },
  423. "printElementType": {
  424. "title": "自定义文本",
  425. "type": "text"
  426. }
  427. }, {
  428. "options": {
  429. "left": 525,
  430. "top": 784.5,
  431. "height": 13,
  432. "width": 63,
  433. "title": "页尾线",
  434. "textAlign": "center"
  435. },
  436. "printElementType": {
  437. "title": "自定义文本",
  438. "type": "text"
  439. }
  440. }, {
  441. "options": {
  442. "left": 12,
  443. "top": 786,
  444. "height": 49,
  445. "width": 49
  446. },
  447. "printElementType": {
  448. "title": "html",
  449. "type": "html"
  450. }
  451. }, {
  452. "options": {
  453. "left": 75,
  454. "top": 790.5,
  455. "height": 13,
  456. "width": 137,
  457. "title": "红色原型是自动定义的Html",
  458. "textAlign": "center"
  459. },
  460. "printElementType": {
  461. "title": "自定义文本",
  462. "type": "text"
  463. }
  464. }, {
  465. "options": {
  466. "left": 334.5,
  467. "top": 810,
  468. "height": 13,
  469. "width": 205,
  470. "title": "页眉线已上。页尾下以下每页都会重复打印",
  471. "textAlign": "center"
  472. },
  473. "printElementType": {
  474. "title": "自定义文本",
  475. "type": "text"
  476. }
  477. }],
  478. "paperNumberLeft": 565.5,
  479. "paperNumberTop": 819
  480. }]
  481. }