2

How to change the dpi from 200 to 300 through ZPL?

I want to use the same ZPL code on printers S4M (200 dpi) and ZT230 (300 dpi).

Dale K
  • 25,246
  • 15
  • 42
  • 71
Carlos Lemos
  • 203
  • 1
  • 4
  • 11

4 Answers4

9

The ^MU command sets the units of measurement the printer uses. ^MU works on a field-by-field basis. Once the mode of units is set, it carries over from field to field until a new mode of units is entered. ^MU also allows for printing at lower resolutions — 600 dpi printers are capable of printing at 300, 200, and 150 dpi; 300 dpi printers are capable of printing at 150 dpi.

Brian
  • 221
  • 2
  • 2
4

I think it is not possible to use the same label for 200 and 300 dpi, dpi stands for dots per inch, all you have to do is make the conversion for example

Rectangle command is

^FO0,0^GB700,0,3^FS
//that means
^startField,x,y^GBwidth,height,lineWeight^endField

In this case width = 700 dots, this means that for a 300dpi printer this will take 2.3 inches and for a 200dpi printer 3.5 inches, so if you want same length in both pritners you can do

700/300 = 2.3, so x/200 = 2.3 then x = 200 * 2.3 , x = 460

This means that if you want a line length of 2.3in, using a 300dpi printer width parameter should be 700 and for a 200dpi printer 460.

Hope this helps

Here is an emulator that might help you

http://labelary.com/viewer.html?density=8&width=4&height=6&units=inches&zpl=%5EXA%0A%0A%5EFO0%2C0%5EGB700%2C0%2C3%5EFS%0A%0A%5EXZ

bto.rdz
  • 6,636
  • 4
  • 35
  • 52
1

For c# users: isatufan made a ZPL-Handler which scales all properties of the ZPL by a given factor:

https://gist.github.com/isatufan/e22dc07ac7968fcb8e9a6046fa15f57a

Not all ZPL-Commands are handled but it is easy to add the missing commands.

Chris Berlin
  • 744
  • 6
  • 15
0

According to the original ZPL bible the coversion can be done to lower.

I keep all my labels in 300, because most of the printers are 300 here, and those where app detects lower res printers it adds this line:

^MUd,200,300

https://www.zebra.com/content/dam/zebra/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf

  • 1
    can't we just use millimeters and avoid the DPI issue completely? `^MUm` – Garr Godfrey Apr 18 '22 at 22:21
  • This is helpful to know, but 200,300 is not a valid combination according to the ZPL manual (I suppose because 300 is not evenly divisible by 200). – ColinM Dec 15 '22 at 03:44