0

I am using a TSC TTP-247 label printer. I am able to print barcodes and texts. Now I want to print graphics. For testing I tried to print a square with 32x32 pixels.

Therefore I built up the following string:

N 
q608
B17,126,0,1,2,4,120,N,"666"
A22,328,0,1,2,2,N,"TEXTFIELD"
GW49,68,4,32,00000000000000003ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc3ffffffc0000000000000000
P1

I double-checked the raw-data for the graphic and I am sure that this raw-data is correct.

Bits of the graphic:
00000000000000000000000000000000
00000000000000000000000000000000
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00111111111111111111111111111100
00000000000000000000000000000000
00000000000000000000000000000000

Converted in bytes:
00000000
00000000
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
3ffffffc
00000000
00000000

The printer is printing something, but not the expected square. The position and the size of the printed graphic seems to be correct. But the graphic itself not.

Here is a picture of the print result:

PRINT RESULT

Any suggestions? Are there other things I have to think about?

Here are some links: Printer documentation: https://www.tscprinters.com/EN/support/Support_Download/TTP-247%20Series

GW command example: https://support.zebra.com/cpws/docs/eltron/gw_command.htm

Kind regards

MHermann
  • 11
  • 2
  • may be an image of the result will tell us more? my bet is your printer either needs different image encoding or you are missing some control codes to switch to gfx mode. In your place I would share at least a link to some docs for your printer (I doubt much people here knows your printer and most of us have not the time/mood/will for searching the docs for you which is lowering your chance of an answer) – Spektre Dec 14 '18 at 08:18
  • 1
    Thanks for your answer. I added a picture, of the print result, to my question.Here are some links: Documentation for the printer: https://www.tscprinters.com/EN/support/Support_Download/TTP-247%20Series Example for the GW command: https://support.zebra.com/cpws/docs/eltron/gw_command.htm – MHermann Dec 14 '18 at 08:47
  • You should add the links to your question (hit the edit button below tags)... anyway I am not familiar with the EPL language but I assume you have wrongly encoded the raw data ... As you got one continuous hex string but the data should be in binary ... so you need to find out how to encode binary data in your language ... in C++ it would be like `char data[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xfc, ... };` so try to find equivalent in your environment – Spektre Dec 14 '18 at 09:02
  • If I am right the data is processed as binary instead of hex so `0000000000000000` is handled as `48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48` where `48 = 0x00110000b` making the starting bar pattern on top of your image (assuming negated ink output) – Spektre Dec 14 '18 at 09:08
  • Thanks for your answers. I checked it. And I am able to get binary data in a QByteArray. I think maybe the problem is located in the way I am sending the data to the printer. To send the data I am building the whole string and give this string via QProcess::startDetached() as a parameter to a shell script. And this script is sending the data to the printer. Is there a better way to send the data to the printer? – MHermann Dec 14 '18 at 10:29
  • I do not know as I am not familiar with the environment you are coding in... If you can intercept the final feed to the printer (like print to file) then you might check what exactly are you sending instead of what you intend to ... – Spektre Dec 14 '18 at 14:02
  • Unfortunately I could not solve this problem until today. But I am thinking in a new direction. Maybe it could be a problem with the codepage? What codepage should I use for printing graphics? Or does the codepage not matter? – MHermann Jan 17 '19 at 12:20
  • You should use ASCII or extended ASCII or even binary ... once you are tapping into code pages you might have a problem of sending/converting UNICODE into printer ant its does not know how to handle it .... – Spektre Jan 17 '19 at 21:22

1 Answers1

0

You need to put your hex code in some hex editor to produce your final code. It would be something like:

0D 0A 4E 20 0D 0A 71 36 30 38 0D 0A 42 31 37 2C 31 32 36 2C 30 2C
31 2C 32 2C 34 2C 31 32 30 2C 4E 2C 22 36 36 36 22 0D 0A 41 32 32
2C 33 32 38 2C 30 2C 31 2C 32 2C 32 2C 4E 2C 22 54 45 58 54 46 49
45 4C 44 22 0D 0A 47 57 34 39 2C 36 38 2C 34 2C 33 32 2C 00 00 00
00 00 00 00 00 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F
FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF
FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F
FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF
FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F FF FF FC 3F
FF FF FC 3F FF FF FC 00 00 00 00 00 00 00 00 0D 0A 50 31 0D 0A

You may want to give a try to "HxD free hex editor" to compile your file as:

N 
q608
B17,126,0,1,2,4,120,N,"666"
A22,328,0,1,2,2,N,"TEXTFIELD"
GW49,68,4,32,        ?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü?ےےü        
P1

Screenshot of sample Code for 32x32 Image

Regards