Go Down

Topic: Thermal printer isn't Printing Images (Read 4 times) previous topic - next topic

Retroplayer

Your code looks like it should work, except this part when it starts the GS mode.

Thermal.write(29);
  Thermal.write(47);
  Thermal.write(1);
  Thermal.println("Image ...");

"This command is ignored if a downloaded bit image has not been defined."

"GS * n1 n2 d1…dk     Define downloaded bit image"

I think you may be using different kinds of modes. There are a few different ones. The GS /n mode requires you to have defined the image, but that is not what you have done yet.

"GS v 0 p wL wH hL hH Print raster bit image" I think this is the one you want to print a raw Bitmap.

I am not positive that I am right. The datasheet is a bit confusing and have several modes. Unfortunately since I cannot experiment with it, you must. :)

Retroplayer

I *think* the first mode is just defining a space in buffer for the image, not the actual image. 

Riva

#27
Feb 12, 2013, 12:51 pm Last Edit: Feb 12, 2013, 02:26 pm by Riva Reason: 1
Having had a quick look at the printer manuals and the Adafruit library the problem looks like difference in commands sent to printer to print raster images.
The Adafruit printer does bitmaps with
Code: [Select]
DC2 * r n [d1…dn]
but to do the equivalent command with your printer is
Code: [Select]
GS v 0 p wL wH hL hH [d1…dk]
You either need to write a new printBitmap function in the Adafruit library to allow for the extra parameters or maybe modifying the existing code to use
Code: [Select]
GS * n1 n2 d1…dk
to store the bitmap (deleting all user defined characters) and then use
Code: [Select]
GS / n
to print the downloaded image.

Riva

I have no idea what I'm doing but have attempted to modify the library to print your bitmaps. It compiles but that's as far as I can test it. The library should really be re-written to suit your printer but that's probably beyond my abilities and attention span.  :)

To test it download the attached .h & .cpp files and replace the current ones then alter the Adafruit example to replace printBitmap with printBitmap2. You may need to delete the old library pre-compiled stuff & restart the IDE first.
Code: [Select]
  // Print the 75x75 pixel logo in adalogo.h
  printer.printBitmap2(adalogo_width, adalogo_height, adalogo_data);

  // Print the 135x135 pixel QR code in adaqrcode.h
  printer.printBitmap2(adaqrcode_width, adaqrcode_height, adaqrcode_data);


Fingers crossed.


Go Up