|
340 | 340 | }
|
341 | 341 |
|
342 | 342 | if (command.type === 'qrcode' && command.command === 'print') {
|
343 |
| - result += `<div class='placeholder ${command.type} ${align}'><div>qrcode</div></div>`; |
| 343 | + result += `<div class='placeholder ${command.type} ${align}'><img src='http://bwipjs-api.metafloor.com/?bcid=qrcode&text=${command.value}' onerror="this.style.display='none'"></div>`; |
344 | 344 | }
|
345 | 345 |
|
346 | 346 | if (command.type === 'pdf417' && command.command === 'print') {
|
347 |
| - result += `<div class='placeholder ${command.type} ${align}'><div>pdf417</div></div>`; |
| 347 | + result += `<div class='placeholder ${command.type} ${align}'><img src='http://bwipjs-api.metafloor.com/?bcid=pdf417&text=${command.value}' onerror="this.style.display='none'"></div>`; |
348 | 348 | }
|
349 | 349 |
|
350 | 350 | if (command.type === 'barcode' && ! command.property) {
|
351 |
| - result += `<div class='placeholder ${command.type} ${align}'><div>barcode</div></div>`; |
| 351 | + let symbologies = { |
| 352 | + 'upca': 'upca', |
| 353 | + 'upce': 'upce', |
| 354 | + 'ean13': 'ean13', |
| 355 | + 'ean8': 'ean8', |
| 356 | + 'code39': 'code39', |
| 357 | + 'coda39': 'code39', |
| 358 | + 'itf': 'interleaved2of5', |
| 359 | + 'interleaved-2-of-5': 'interleaved2of5', |
| 360 | + 'nw-7': 'rationalizedCodabar', |
| 361 | + 'codabar': 'rationalizedCodabar', |
| 362 | + 'code93': 'code93', |
| 363 | + 'code128': 'code128', |
| 364 | + 'gs1-128': 'gs1-128', |
| 365 | + 'gs1-databar-omni': 'databaromni', |
| 366 | + 'gs1-databar-truncated': 'databartruncated', |
| 367 | + 'gs1-databar-limited': 'databarlimited', |
| 368 | + 'gs1-databar-expanded': 'databarexpanded', |
| 369 | + 'code128-auto': 'code128', |
| 370 | + } |
| 371 | + |
| 372 | + result += `<div class='placeholder ${command.type} ${align}'><img src='http://bwipjs-api.metafloor.com/?bcid=${symbologies[command.value.symbology]}&text=${command.value.data}' onerror="this.style.display='none'"></div>`; |
352 | 373 | }
|
353 | 374 |
|
354 | 375 | if (command.type === 'image') {
|
|
795 | 816 | }
|
796 | 817 | #output[data-format="text"] .placeholder * {
|
797 | 818 | display: block;
|
| 819 | + width: calc(var(--width-a) * 24); |
| 820 | + height: calc(var(--height-a) * 4); |
798 | 821 | }
|
799 | 822 | #output[data-format="text"] .placeholder div {
|
800 | 823 | background: #ddd;
|
|
0 commit comments