Printing from Xchange with SMSQmulator

Discussion and advice about emulating the QL on other machines.
Post Reply
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Printing from Xchange with SMSQmulator

Post by swensont »

I rarely print anything from QL programs running under SMSQmulator. I normally convert the document files to text, format them using Open Office and print. Recently, I was thinking about printing from Xchange that is running under SMSQmulator. I remember folks having issues in the past, but I never gave it any mind, as I just don't print.

So, I thought I would give it a try and see how hard it is. Since there is no way to get the QL serial port to connect to anything connected to the underlying OS, I knew that I had to print to a file. Most parts of the Xchange suite allow printing to a file. To get the file out to the underlying OS, I used the NFA device. I told Xchange to print to the file "nfa1_test_prn".

Since I'm running Linux, getting the print file to my printer is pretty trivial:

% lpr test_prn

lpr (line printer) sends the file directly to the default printer setup under CUPS (the Linux printer configuration system). That just happened to be a network printer sitting in the garage (an HP 8100 with a JetDirect network card).

Since the printer speaks PCL, to get anything fancy, all I would have to do is edit the printer configiuration file in Xchange for this. PCL uses escape sequences to start commands (just like the older Epson printers did).

Now, if I wanted to make this more seamless, I could write a shell script that would scan a certain directory for any file ending in "_prn" and pass that file to lpr. This would be fairly easy to write and it could then be added to the start up rc scripts to run at boot time. A co-worker of mine did something like this back in the late 80's in a similar print scheme.

This whole project took up about 30 minutes of my time one evening (from concept to finish). Simple, but something I had not tried before.


User avatar
vanpeebles
Commissario Pebbli
Posts: 2816
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Printing from Xchange with SMSQmulator

Post by vanpeebles »

QL'ing on Christmas morning, that's dedication for you :)


swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Printing from Xchange with SMSQmulator

Post by swensont »

It was Christmas morning your time, but it was Christmas Eve my time. :-)


User avatar
vanpeebles
Commissario Pebbli
Posts: 2816
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Printing from Xchange with SMSQmulator

Post by vanpeebles »

Doh! You have me there :lol:


Post Reply