Post Reply 
Modern thermal printer to emulate 82240B
02-28-2018, 05:37 AM (This post was last modified: 07-07-2018 02:13 PM by tcab.)
Post: #8
RE: Modern thermal printer to emulate 82240B
(02-25-2018 11:12 PM)Thomas Okken Wrote:  You could even get graphics this way, using the "print to gif" feature.

I've been playing with this approach today and got something working. The Free42 "print to gif" feature generates sequentially numbered GIF files. Specifying out.gif in Free42 preferences creates the following sequence of files:

Code:

out.0000.gif
out.0001.gif
out.0002.gif
...

My algorithm looks for new files being generated and prints them to the thermal printer. New files are generated once 'Maximum GIF height (pixels)' has been filled (see Free42 preferences). Depending on how the user sets this value, new files can be emitted rarely or very frequently. I want new GIF files as frequently as possible because my goal is to have the thermal printer respond and track Free42 virtual tape output exactly.

It turns out that I cannot print a GIF file until it has been fully flushed and closed by Free42 - till then the file sits at 0 bytes and thus has no content, as far as my external program/script can see. Ideally I need to set the maximum gif height to 10.667 which seems to correspond to exactly one line of Free42 text output. My algorithm:
  • Each Free42 text line that gets emitted to virtual tape is output to a new GIF file
  • That new GIF file containing that line is flushed and closed
  • My program/script sees the new, non zero byte GIF file and prints it to the thermal printer immediately

Nice plan - except Free42 won't let me enter 10.667 into the dialog box, 32 is the minimum value. This means that there is a 'buffer' of 3 lines before you see anything on my epson tm-t20 escpos thermal printer. You may be lucky and your Free42 output happens to correspond with a filling up and closing of the most recent gif file- or you may not be so lucky. I can work around this by manually sending a few paper ADV commands in Free42 to 'flush' things out.

So close to a nice solution! At least I didn't have to modify Free42 and compile it etc :-) This approach works with standard Free42 builds available to everyone. The proliferation of GIF files is a nuisance but my script could potentially delete them as it prints them. And the GIF files seem to mesh perfectly on the thermal printer output - one wouldn't know the output was comprised of separate files.

[Image: epson_thermal_rpn_graphics.JPG?raw=1]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Modern thermal printer to emulate 82240B - tcab - 02-28-2018 05:37 AM



User(s) browsing this thread: 1 Guest(s)