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
 tcab Member Posts: 186 Joined: Dec 2017
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.

 « Next Oldest | Next Newest »

 Messages In This Thread Modern thermal printer to emulate 82240B - tcab - 02-25-2018, 01:24 AM RE: Modern thermal printer to emulate 82240B - Thomas Okken - 02-25-2018, 03:17 AM RE: Modern thermal printer to emulate 82240B - tcab - 02-25-2018, 12:42 PM RE: Modern thermal printer to emulate 82240B - Thomas Okken - 02-25-2018, 11:12 PM RE: Modern thermal printer to emulate 82240B - martinot - 02-26-2018, 06:12 PM RE: Modern thermal printer to emulate 82240B - tcab - 02-28-2018 05:37 AM RE: Modern thermal printer to emulate 82240B - mfleming - 02-26-2018, 02:08 AM RE: Modern thermal printer to emulate 82240B - martinot - 02-25-2018, 11:41 AM RE: Modern thermal printer to emulate 82240B - Marcus von Cube - 02-28-2018, 09:05 PM RE: Modern thermal printer to emulate 82240B - Thomas Okken - 03-01-2018, 01:50 AM RE: Modern thermal printer to emulate 82240B - tcab - 07-04-2018, 11:14 PM RE: Modern thermal printer to emulate 82240B - Thomas Okken - 07-06-2018, 10:54 AM RE: Modern thermal printer to emulate 82240B - tcab - 07-07-2018, 04:52 AM RE: Modern thermal printer to emulate 82240B - StephenG1CMZ - 07-06-2018, 01:59 PM RE: Modern thermal printer to emulate 82240B - tcab - 07-08-2018, 12:10 AM RE: Modern thermal printer to emulate 82240B - rprosperi - 07-07-2018, 12:57 PM RE: Modern thermal printer to emulate 82240B - tcab - 07-07-2018, 02:11 PM RE: Modern thermal printer to emulate 82240B - rprosperi - 07-07-2018, 03:22 PM RE: Modern thermal printer to emulate 82240B - StephenG1CMZ - 07-08-2018, 07:46 PM RE: Modern thermal printer to emulate 82240B - tcab - 08-14-2018, 12:37 AM RE: Modern thermal printer to emulate 82240B - tcab - 08-29-2018, 03:23 AM