Using the ZPL Command ~DY to print a PNG Monochrome Graphic on a label

Article ID: 54080233

Details

Description

Printing a PNG graphic on a label using the ZPL command ~DY

Applies To

ZPL compatible printers V60.14.x, V50.14.x  and later 

Excludes the non- ZPL language printers: 2824 Series, 2844 Series, S4M (E53 Firmware Version), ZM Series (E53 Firmware), 888 DD/TT Series, MZ Series, ZQ110, EM220, EM220II, All Kiosk (except KR403)

Requirements

For this example you will need a compatible printer and a monochrome PNG file.

Overview

Printing a graphic from a PNG file is best done using the Zebra Driver, Zebra Setup Utility. or ZebraNet Bridge. If you cannot use these methods we are providing an example of how this can be done using ZPL. Specifically the ~DY command.

~DY Command Details Read More>>

Using ZebraNet Bridge to convert a PNG File (no purchase required) Read More>>

Procedure

The ~DY can be used to download a known file type (bmp, png, pcx). The actual data and the file size in bytes is required. To get the file size, the customer will need to know the actual size, which can be done in the command prompt with the ‘dir’ command.

 User-added image

Since a PNG file is a compressed file, it will need to be sent as  ASCII hex or as B64 (which can be done very easily in Notepad++. (free application available on the internet)

Here is a sample.PNG file Read More>>

Here is the ZPL used for printing the sample graphic Read More>>

Additional Information

Make sure the graphic is monochrome as indicated by the Properties - Bit depth = 1 

User-added image