# Fabric Roll Barcode Label ZPL Generator for Zebra Printers

> Source: https://netray.co/tools/fabric-roll-barcode-label-zpl-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Generate ZPL II code for a 4 inch fabric roll label with item, lot, width, length and a Code 128 roll ID barcode.

## Category

mes-shop-floor

## Industry

Textile and Apparel

## Audience

- Warehouse supervisor
- ERP developer
- Plant manager
- Inventory controller

## Tool

**Kind:** template

**Output:** code

**Language:** text

**Fields:**

#### Company name

**Key:** company

**Type:** text

**Default:** Acme Textiles Ltd

#### Fabric item code

**Key:** fabric_code

**Type:** text

**Default:** CTN-POP-120-WHT

#### Dye or production lot

**Key:** lot

**Type:** text

**Default:** LOT-24-0815

#### Usable width

**Key:** width

**Type:** text

**Default:** 150 cm

#### Roll length

**Key:** length

**Type:** text

**Default:** 62.5 m

#### Roll ID (barcode value)

**Key:** roll_id

**Type:** text

**Default:** R0008841

**Blocks:**

#### Single 4 x 3 inch label at 203 dpi

**Body:** ^XA
^PW812
^LL609
^CI28
^CF0,36
^FO40,30^FD{{company}}^FS
^CF0,30
^FO40,90^FDItem: {{fabric_code}}^FS
^FO40,140^FDLot: {{lot}}^FS
^FO40,190^FDWidth: {{width}}^FS
^FO40,240^FDLength: {{length}}^FS
^BY3,3,130
^FO40,320^BCN,130,Y,N,N^FD{{roll_id}}^FS
^XZ

#### Reprint two copies

**Body:** ^XA
^PQ2
^PW812
^LL609
^CF0,30
^FO40,40^FDItem: {{fabric_code}}^FS
^FO40,90^FDRoll: {{roll_id}}^FS
^BY3,3,130
^FO40,160^BCN,130,Y,N,N^FD{{roll_id}}^FS
^XZ

**Notes:** Coordinates assume a 203 dpi printer and a 4 x 3 inch label, where ^PW812 sets the print width in dots and ^LL609 the label length. For 300 dpi printers, scale the dot values by about 1.5. Send the code to the printer as raw text, and test one label on your stock before printing a batch. Fields with special characters such as the caret or tilde may need escaping.

## Content

**Intro:** A readable, scannable roll label is what keeps fabric from being lost in a warehouse. This generator builds ZPL II code for Zebra-compatible printers, with item, lot, width, length and a Code 128 roll ID barcode.

**Sections:**

#### How to use the generator

**Body:** Fill the fields with your roll data and copy the code from the first block. Send it to the printer as raw text through the printer port, a print spooler set to raw mode, or a labeling tool. The barcode encodes the roll ID, so a scan at receiving, cutting and issue can look up item, lot and quantity from your inventory system. The second block reprints a label with a quantity command.

**Bullets:**

- Send as raw text, not through a graphics driver
- Barcode holds the roll ID only
- Keep item, lot, width and length readable for people
- Use the reprint block for damaged labels

#### What the ZPL commands do

**Body:** Every label starts with ^XA and ends with ^XZ. ^PW sets print width and ^LL sets label length in dots. ^CF sets the default font and size. ^FO places a field origin, and ^FD ... ^FS holds the data. ^BY sets bar width and ratio, and ^BC prints Code 128. ^PQ sets the quantity of copies. At 203 dpi, one inch is 203 dots, so a 4 inch label is about 812 dots wide.

#### Common mistakes and ERP notes

**Body:** The most common faults are barcodes too small or too close to the edge for the scanner, and printing to a driver that rescales the code. Store the roll ID as the key to your inventory record, and make sure the lot on the label matches the lot in the ERP, because shade variation between dye lots is the main reason fabric is segregated. Test scanning at the real warehouse distance.

**Bullets:**

- Leave quiet space on both sides of the barcode
- Match the lot on the label to the ERP lot
- Print a test label per stock before each run

**Cta:** If roll labels are typed by hand or printed from separate files, we can show how to print them straight from receiving transactions in your ERP.

**Faq:**

#### What is ZPL?

**Answer:** ZPL, or Zebra Programming Language, is a text command language that Zebra and many compatible label printers use. You send plain text commands to the printer, and it draws text and barcodes at the positions you specify.

#### Why is my label printing off to one side?

**Answer:** The print width, label length or origin values likely do not match your stock or printer resolution. Check that the ^PW and ^LL values match the label size at your dpi, and run the printer's media calibration.

#### Which barcode type should I use for roll IDs?

**Answer:** Code 128 is a common choice because it is compact, supports letters and digits and is read by nearly every scanner. Keep the roll ID short to keep bars wide enough to scan reliably.

#### How do I print many labels at once?

**Answer:** Use ^PQ for copies of the same label. For unique roll IDs, generate one ^XA to ^XZ block per roll, usually from your ERP or a script, and send the whole file to the printer in one job.

## Search terms

fabric roll label zpl, zebra zpl label generator, textile roll barcode label, code 128 zpl example, roll id label template, fabric inventory barcode, zpl label code sample, fabric warehouse labels

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
