@schie/fluent-zpl - v0.10.0
    Preparing search index...

    Function label

    • Tagged template literal for parsing ZPL strings into Label instances.

      Parameters

      • strings: TemplateStringsArray

        Template literal string parts

      • ...values: (string | number)[]

        Interpolated values

      Returns Label

      Label instance for continued chaining

      The label tagged template allows you to embed ZPL code directly in your TypeScript/JavaScript and get back a fluent Label instance that you can continue to chain methods on.

      Template literals can include interpolated values using ${} syntax, which will be inserted into the ZPL string before parsing.

      Whitespace (including indentation) is preserved exactly as written. Align your template strings to column 0 if you do not want leading spaces emitted with your ZPL.

      import { label } from '@schie/fluent-zpl'

      const trackingNumber = '1234567890'

      const myLabel = label`
      ^XA
      ^FO50,50^A0N,28,28^FDShipping Label^FS
      ^FO50,100^BCN,80,Y,N,N^FD${trackingNumber}^FS
      ^XZ
      `

      // Continue chaining fluent methods
      myLabel.text({ at: { x: 50, y: 200 }, text: 'Additional text' })
      .toZPL()
    • Tagged template literal for parsing ZPL strings into Label instances.

      Parameters

      • strings: TemplateStringsArray

        Template literal string parts

      • ...args: [...(string | number)[], { dpi?: DPI; units?: Units }]

      Returns Label

      Label instance for continued chaining

      The label tagged template allows you to embed ZPL code directly in your TypeScript/JavaScript and get back a fluent Label instance that you can continue to chain methods on.

      Template literals can include interpolated values using ${} syntax, which will be inserted into the ZPL string before parsing.

      Whitespace (including indentation) is preserved exactly as written. Align your template strings to column 0 if you do not want leading spaces emitted with your ZPL.

      import { label } from '@schie/fluent-zpl'

      const trackingNumber = '1234567890'

      const myLabel = label`
      ^XA
      ^FO50,50^A0N,28,28^FDShipping Label^FS
      ^FO50,100^BCN,80,Y,N,N^FD${trackingNumber}^FS
      ^XZ
      `

      // Continue chaining fluent methods
      myLabel.text({ at: { x: 50, y: 200 }, text: 'Additional text' })
      .toZPL()
    Index

    Methods

    Methods

    • Alternative syntax for the label template with explicit options

      Parameters

      Returns (strings: TemplateStringsArray, ...values: (string | number)[]) => Label

      const myLabel = label.withOptions({ dpi: 300, units: 'mm' })`
      ^XA
      ^FO50,50^A0N,28,28^FDHigh DPI Label^FS
      ^XZ
      `