previewSystemTemplate.ts 1.89 KB
import type { SystemLabelTemplate } from '../types/printer'

export const PREVIEW_SYSTEM_TEMPLATE: SystemLabelTemplate = {
  id: 'template-preview-json-print',
  name: 'Preview JSON Template',
  labelType: 'PRICE',
  unit: 'inch',
  width: 4,
  height: 2,
  appliedLocation: 'ALL',
  showRuler: true,
  showGrid: true,
  elements: [
    {
      id: 'el-title',
      type: 'TEXT_STATIC',
      x: 104,
      y: 16,
      width: 160,
      height: 24,
      rotation: 'horizontal',
      border: 'none',
      config: {
        text: 'FOOD LABEL',
        fontFamily: 'Arial',
        fontSize: 14,
        fontWeight: 'bold',
        textAlign: 'center',
      },
    },
    {
      id: 'el-product-name',
      type: 'TEXT_PRODUCT',
      x: 96,
      y: 128,
      width: 120,
      height: 24,
      rotation: 'horizontal',
      border: 'none',
      config: {
        text: 'Product',
        fontFamily: 'Arial',
        fontSize: 14,
        fontWeight: 'normal',
        textAlign: 'left',
      },
    },
    {
      id: 'el-category',
      type: 'TEXT_STATIC',
      x: 88,
      y: 152,
      width: 140,
      height: 24,
      rotation: 'horizontal',
      border: 'none',
      config: {
        text: '{{category}}',
        fontFamily: 'Arial',
        fontSize: 14,
        fontWeight: 'normal',
        textAlign: 'left',
      },
    },
    {
      id: 'el-qrcode',
      type: 'QRCODE',
      x: 128,
      y: 40,
      width: 80,
      height: 80,
      rotation: 'horizontal',
      border: 'none',
      config: {
        data: '{{qrCode}}',
        errorLevel: 'M',
      },
    },
    {
      id: 'el-barcode',
      type: 'BARCODE',
      x: 208,
      y: 128,
      width: 160,
      height: 48,
      rotation: 'horizontal',
      border: 'none',
      config: {
        barcodeType: 'CODE128',
        data: '{{barcode}}',
        showText: true,
        orientation: 'horizontal',
      },
    },
  ],
}