Labels have a width and height in mm e.g. 70mm wide x 30 mm high.
The printer has a resolution, typically 203dpi or 300 dpi.
There are 25.4 millimeters in one inch, DPI = dots per inch
To work out the "dots" for ZPL commands to set width, length and position of elements you can use the following:
70 mm ÷ 25.4 = 2.7559 inches (rounded to 4 decimal places)
2.7559 inches × 300 dpi = 826.77 dots
a 70mm wide label on 300dpi printer has 827 dots approximately.
In a ZPL label print, we typically set the label dimensions near to the top of the ZPL code.
For a 70mm wide label we would use
^PW827