CUPS rastertoql filter  1.0.4
Filter for the Brother QL family of label printers
How the Filter deals with margins

Horizontal:

If the dot count in a line in the CUPS raster exceeds the maximum of 720 dots the print head has, the filter removes the same amount of dots at the left and right line ends and sends exactly 720 dots to the printer device.

If the dot count in a line in the CUPS raster is below the maximum of the selected medium (or the maximum dots of the print head), it will right align the available dots per line and sends the result to the printer device.

Vertical:

For continous labels, all CUPS raster lines are sent to the printer device. You do not need margins at the top and bottom edge. The printer device itself will add 3 mm at both ends and then cut the label.

For pre-cut labels the filter always ignores 3 mm of data at the top and at the bottom of the CUPS raster. At 300 DPI this means 35 lines each and at 600 DPI (only some QL models) 70 lines each. The remaining raster lines are sent to the printer device. For this case you need to add these 3 mm margins to your label, e.g. it must provide lines for the full size of the label.

Example:

For a DK1201 roll of pre-cut labels of size 29 mm x 90 mm:

  • define a label of exact this size
  • add 3 mm margin at its top and bottom edges
  • add 1mm margin at its right edge
  • add 0.5 mm margin at its left edge

This label should create a CUPS raster of exact:

  • 342 dots per line
  • 1061 lines

For a test, if your label fits into this size, you can run the pdftoraster filter on your PDF. Safe its output to a file and run the command file on it. It should output something like this:

 Cups Raster version 3, Little Endian, 300x300 dpi, 342x1061 pixels 8 bits/color 8 bits/pixel ColorOrder=Chunky ColorSpace=gray

The important part of this output is the 342x1061 pixels.

Attention
The line count must match the 1061 for the DK1201 roll. The dots per line value 342 can differ (a little bit).