Downloading Logos or Images to Printers the Easy Way

  • By Lee Peterson 8 Months Ago

Our church prints a couple of custom logos on labels, and they're stored on the printers (a way to optimize printing—see Printing Images and Logos on Your Check-In Labels). Of course, over time those logos will change, and it would take many hours to corral and carry printers to the desk (or run Zebra Font Downloader on every check-in machine, since we use PC clients) just to install a new graphic file.

Here's a way to download and store a printable image or graphic on all your printers by simply checking someone in and printing a label on each printer (technically you don't have to print a label, but it'll help us make sure it worked). This will make life a lot easier every time someone wants a new "pretty picture" on your labels.

To give you an idea of where we're headed, let's start by creating a new label in Rock. Name it whatever you like (of course, set the Mime type to text/plain)  and in the label editor window type ^XA^WDE:^XZ (all on one line, or on separate lines—it doesn't matter). Save the label. Assign it to a check-in area, turn on check-in, and check someone into this area. See what prints? E: "drive" is where custom fonts and graphics are stored on our printers. We can execute commands on printers simply by sending them via a label.


Screen Shot 2018-03-15 at 4.33.47 PM.png


Screen Shot 2018-03-15 at 4.34.06 PM.png

IMG_2830.jpg


How we'll download and save images on our printers:

  • We'll experiment and practice by creating a test "command" label in Rock containing the commands necessary to store a test image on your printer 
  • Use Labelary to convert your new image to the correct format
  • Change the test label to contain your new image
  • Print this label at every check-in kiosk

This is a lot easier than it looks. Hang in there, follow these instructions carefully, and you'll be a pro in no time.


Create a test "command" label

In the next few steps we'll create a test label containing the ZPL code necessary to:

  1. get a directory of the E: drive;
  2. download a test image to the printer;
  3. print another directory so we can make sure the graphic actually downloaded;
  4. delete the graphic from the printer

Open your test label (from the previous step) in the Rock label editor. Copy and paste the following code into the editor window, and save it.

Caution! If you have a file called "CHURCH.GRF" on your printers now, change the file name in the two commands below or you'll lose your existing file. This will only apply if you've previously downloaded a file with that name to your printers. Maybe I should have chosen a different name!


^XA^WDE:^XZ

^XA
~DYE:CHURCH,A,G,8192,32,,:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::gQ03,gQ038,::gQ03C,:gQ0FF,gP0IFE,gO01JF,gP0JF,gP07FFC,gQ03C,:::gQ038,::::::gQ03C,::gQ07C,gQ07E,gQ0FF,gP01FF,gP01FF8,gP03FFC,gP07FFC,gP0IFE,gP0JF,gO01JF,gO03JF8,gO03JFC,gO07JFC,gO0KFE,gO0LF,gN01LF,gN03LF8,gN03LFC,gN07LFC,gN07LFE,:gN07FE007FC,gN07FC003FC,::::gN07FC003F8,::gN03FC003F8,:::::gN03LF8,:::::::::::::gN0MFC,gM03NF,gM0OFC,gL03PF,gK01QFC,gK07RF,gJ01SFC,gJ0MFE7LF,gI03MFC3LFC,gI07MF81MF,gI07MF00MFC,gI07MF00MFE,gI07MF007LFE,gI03LFE007LFE,gJ01KFE007LFE,gJ01KFE003KF,:::::::::::::::::gJ01KFC003KF,gK0KFC003KF,::gK01IF8J03IF,,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::^FS
^XZ

^XA^WDE:^XZ

^XA^FO20,20^XGE:CHURCH.GRF^XZ

^XA^IDE:CHURCH.GRF^XZ


Here's what this code is doing:

  • ^WDE: prints a directory so you can see what's on the E: drive before it downloads the graphic
  • The ~DY command creates a file on the E: drive called CHURCH, in ASCII, and it assigns the .GRF extension for a graphic. There are 8192 bytes of data, and each row of the graphic contains 32 bytes. The rest is all a binary bitmap of the image
  • Another directory prints (^WDE: again) so you can see that there's now a file called "CHURCH.GRF" on the E: drive
  • It prints the now-stored image on a third label, proving that it actually installed the graphic
  • Finally, it deletes the graphic (the ^IDE:CHURCH.GRF command) from your printer (so we don't leave it there and fill up your printer's limited flash memory)


The bottom label printed first (notice that CHURCH.GRF is not listed on the bottom label, but is on the middle one):

  • IMG_2814.jpg

Assuming that this worked correctly, you're ready to move on.


Convert your image to the correct format

You can use ZebraDesigner to do the following, but I'd suggest using Labelary instead:

1) Create (or locate) an image exactly the size you want to print on your label. It will print dot-for-pixel, so if you want to print an inch-square image on a 203-dpi printer, it needs to be 203 x 203 pixels. A 4" x 2" inch label is about 812 dots wide and 406 dots tall. As far as format goes, Labelary claims to work with "a wide variety of formats" (the .PNG I tried was blank, though). An image can't be resized by the printer (well, it can be, but only by integer multiples: doubled, tripled, etc.). I don't have any great suggestions for creating graphics that will print well other than to experiment.

2) We need to convert our image to a bitmap ".GRF" format usable by our printer. In the Labelary viewer window, delete the sample label code. Type ^XA, skip a couple lines, and type ^XZ. Put the cursor back between those two lines, and click the "Add Image" button. Locate the correct image on your computer. Labelary converts it and places the image code in the viewer window. Click the "Redraw" button and your image should display in the preview window. This gives you a pretty good sense of what it will look like when printed—this would be a good time to work on your image if it looks "unacceptable".


Screen Shot 2018-03-21 at 8.24.21 AM.png


3) We need to modify the output from Labelary so it includes the ~DYE command below. This has to be exactly right, so pay close attention. You should have something like this in Labelary (I took a lot out in the middle for clarity):


^FO50,50^GFA,38400,38400,80,,:::::::::::::::::::::::::::::::::::::::::iW08,,::::::::::

...
EK03FF,hY07CK0E7KF80LFC0LF01F,hY01U0LF80FFE,,::::::::::::::::^FS


you will need to replace  ^FO50,50^GFA,38400, which prints the image on a label

with this: ~DYE:YOURFILE,A,G, which stores the image on your printer.

It should look exactly like this: ~DYE:YOURFILE,A,G,38400,80,,:::::::::::::::::::::::::::::::::::::::::iW08,,::::::::::

Important: YOURFILE is just the one- to eight-character filename you're assigning. The .GRF extension is assigned by the "G". The file size and number of rows (38400,80 in the example) will be the file size Labelary calculated for your image.

Also, this new command doesn't contain the information to display or print a label—Labelary will warn you if you click "Redraw".

Whew! Now that we've done the hard part,


Change your test label to contain the image you just converted

Go back to your test label in Rock, and go into the label editor. Replace the test image (starting with ~DYE... and ending with ^FS) with the exact code from the Labelary window. You can leave the two directory commands if you like (that way you'll know it actually worked), and leave or delete the image printing section. I like the visual confirmation that it worked. Of course, you'll want to remove the last line with ^IDE:, or it'll delete your new image.

When you're sure this part works correctly (you're testing thoroughly, right?),


Print this "label" at every kiosk

Enable check-in (if it's not already up), make sure this "label" is assigned to a check-in area, and find someone who can check into that area (I'll bet you already have a test family you use for situations like this). If you don't allow duplicate check-in, you might want to enable it temporarily so you don't have to have a list of people who can check in. All that matters is that we need this label to be transferred to every printer by checking someone into the area(s) to which it's attached.

if you're like us, it's difficult to access some check-in stations and printers during the week. You could attach just the "download and store" label to some check-in areas temporarily on a Sunday morning (for however long it takes for you to make sure each station is used), then remove that label from its area(s). It's probably not ideal to leave it there for a whole day (for a couple reasons: flash memory has a limited life for writing, and it's possible the printer would pause and defragment memory multiple times), but I would think that a whole service should be fine. You should test before you do this. For what it's worth, it appears from the Zebra documentation that the file writes and saves every time the label "prints".


Now that the image is on every printer you can print it on labels as described in the Shoulder the Boulder article mentioned at the top.

I hope this article helps to save you time and make life easier. My next article will explain how to install fonts the same way. Used together, it will be possible to configure new printers by simply "printing" a series of labels containing fonts and images on each one.

If you need more information about ZPL, consult the ZPL Programming Guide.

Please contact me on the Slack forum if you have questions or suggestions.





@lee_peterson
Spark Core Team

Spark Core Team. In a previous life I owned an auto repair shop. In the present I serve at Flatirons Community Church in Lafayette, CO as a volunteer fixer of broken things (not people -- that's up to Jesus!).