jbenjamin
Posts: 3
Joined: Wed Oct 16, 2019 7:09 pm

Printer Emulator

Thu Oct 17, 2019 3:02 pm

Hi! I want to make my raspberry pi into a printer emulator (I don't have one yet so I'm open to using any that is most efficient for this purpose). Basically when I connect my raspberry pi, I want the PC to think an USB printer is connected. If possible, I wouldn't mind if the raspberry pi the documents that the PC sends to print and saved it somewhere as a digital copy. The reason I am looking for a printer emulator is that the PC is an old DOS based system that needs a printer to be connected in order to run, and simply plugging in a USB is not helping :roll: . The thing I am really confused is what signals does the emulator need to send to make the PC believe it's a printer. Please let me know if you have any ideas :D .

fruitoftheloom
Posts: 20909
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Printer Emulator

Thu Oct 17, 2019 5:44 pm

jbenjamin wrote:
Thu Oct 17, 2019 3:02 pm
Hi! I want to make my raspberry pi into a printer emulator (I don't have one yet so I'm open to using any that is most efficient for this purpose). Basically when I connect my raspberry pi, I want the PC to think an USB printer is connected. If possible, I wouldn't mind if the raspberry pi the documents that the PC sends to print and saved it somewhere as a digital copy. The reason I am looking for a printer emulator is that the PC is an old DOS based system that needs a printer to be connected in order to run, and simply plugging in a USB is not helping :roll: . The thing I am really confused is what signals does the emulator need to send to make the PC believe it's a printer. Please let me know if you have any ideas :D .

Only the Raspberry Pi Zero and 4B can be in "Gadget Mode" aka USB Client, see:

https://blog.gbaman.info/?p=699

https://blog.gbaman.info/?p=791


Though can not understand why you can not plug a USB Printer into the "DOS" machine.
Retired disgracefully.....

User avatar
scruss
Posts: 2548
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Printer Emulator

Thu Oct 17, 2019 7:09 pm

Have you seen the Retro-Printer? I don't know how well it works, but the developer has been around a long time, and they've done quite a bit on producing a driver that accepts old dot-matrix codes and prints the result as PDF.

Sometimes an elderly workflow is irreplaceable, and this is exactly why RWAP made this device.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

jbenjamin
Posts: 3
Joined: Wed Oct 16, 2019 7:09 pm

Re: Printer Emulator

Fri Oct 18, 2019 3:09 pm

Though can not understand why you can not plug a USB Printer into the "DOS" machine.
Currently that is what we are doing. But the thing is that we really don't want the hard copy of the files, and it is just a waste of space if we are not going to use it much.
Have you seen the Retro-Printer?
It looks promising, but it seems like you need a centronics port, which the system does not have

PiGraham
Posts: 3665
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Printer Emulator

Fri Oct 18, 2019 3:50 pm

It seems to me you would first need to know what printers your 'DOS computer' supports. It you will emulate a printer it would be one of those the legacy machine supports.

Alternatively you might consider writing a printer driver to run on the DOS machine Then you could make the driver write the rendered print image to file on a networked file server or a local USB storage device.

Indeed somebody has probably done that already.
Maybe this is useful, although I see no mention of it running of antique machines. Maybe DOS emulators on windows?

https://www.printfil.com/?gclid=CjwKCAj ... LgQAvD_BwE


Either way diy it sounds like a very challenging project.

if at all possible find a way to convert the source document file into a format that a modern machine can print (to file or otherwise).

User avatar
scruss
Posts: 2548
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Printer Emulator

Fri Oct 18, 2019 6:48 pm

I'm guessing that there's a small list of USB printers that are supported, since the overlap between MS-DOS and USB is not very great?
(unless this is a Windows command terminal application, which would mean it's more likely to support more printers - but isn't really running under DOS)

In theory, you could use the Linux USB Printer Gadget module (g_printer) to make a Raspberry Pi Zero appear as a USB printer. You'd have to find the correct USB Vendor and Product ID so that your computer might identify the fake printer correctly: but that would require you to work out which printers are supported by your DOS program, and which printers support spooling data in a format you can convert to something useful.

(For example, a HP LaserJet P3005 mono laser from ~2006 supports USB, and talks both PostScript and PCL. PostScript's usually trivial to convert to PDF, PCL would need GhostPDL. Whether these formats get spooled via USB in a way that g_printer's prn_example code can read is a big question.)

In practice, no one on this board has documented a working solution with g_printer, though some have thought about it: g_printer search results

A device that claims to do this is the RedTitan Virtual Printer: again, untried.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

jbenjamin
Posts: 3
Joined: Wed Oct 16, 2019 7:09 pm

Re: Printer Emulator

Wed Oct 23, 2019 8:50 pm

scruss wrote:
Fri Oct 18, 2019 6:48 pm
A device that claims to do this is the RedTitan Virtual Printer: again, untried.
Talked to a rep from them and it may work, but it is really expensive.

RWAP
Posts: 20
Joined: Tue Aug 09, 2016 8:49 am

Re: Printer Emulator

Sun Nov 03, 2019 9:00 pm

jbenjamin wrote:
Fri Oct 18, 2019 3:09 pm
Though can not understand why you can not plug a USB Printer into the "DOS" machine.
Currently that is what we are doing. But the thing is that we really don't want the hard copy of the files, and it is just a waste of space if we are not going to use it much.
Have you seen the Retro-Printer?
It looks promising, but it seems like you need a centronics port, which the system does not have

What does the system use to connect the original printer? A parallel port, a serial port, or a USB port?

The Retro-Printer works with a centronics port (or parallel to centronics cable), and we have also used it with a USB to serial port adaptor.

If you want to capture the output from a USB port, then you can use a USB to centronics adaptor - there are lots of cheap options, or look at something more like our Interceptor software emulator - although that is designed to sit between a USB printer and a USB port....
Last edited by RWAP on Sun Nov 03, 2019 9:12 pm, edited 1 time in total.

RWAP
Posts: 20
Joined: Tue Aug 09, 2016 8:49 am

Re: Printer Emulator

Sun Nov 03, 2019 9:09 pm

scruss wrote:
Fri Oct 18, 2019 6:48 pm
I'm guessing that there's a small list of USB printers that are supported, since the overlap between MS-DOS and USB is not very great?
(unless this is a Windows command terminal application, which would mean it's more likely to support more printers - but isn't really running under DOS)

In theory, you could use the Linux USB Printer Gadget module (g_printer) to make a Raspberry Pi Zero appear as a USB printer. You'd have to find the correct USB Vendor and Product ID so that your computer might identify the fake printer correctly: but that would require you to work out which printers are supported by your DOS program, and which printers support spooling data in a format you can convert to something useful.

(For example, a HP LaserJet P3005 mono laser from ~2006 supports USB, and talks both PostScript and PCL. PostScript's usually trivial to convert to PDF, PCL would need GhostPDL. Whether these formats get spooled via USB in a way that g_printer's prn_example code can read is a big question.)

In practice, no one on this board has documented a working solution with g_printer, though some have thought about it: g_printer search results

A device that claims to do this is the RedTitan Virtual Printer: again, untried.

This is basically what we did for the Interceptor module - although we didn't try the software on a Raspberry Pi 4B - we got it working on Banana Pi M1+ and Odroid C1/C1+ / C2 - see https://www.retroprinter.com/the-rwap-interceptor-s/

This reads the parameters of a connected default USB printer and then sets the gadget printer to mimic the USB printer. It would need to be adapted to store the output - as it was designed to be a printer capture device in time critical situations, we avoided the actual print conversion (which slows down the printing process).

If you only wanted to create a PDF of the captured output, then you are stuck with questioning what printer language you need to capture and convert..

Is it plain text? For a USB printer, this is unlikely.
Is it PCL ? Easy - you can use GhostPCL for this.
Is it ESC/P or ESC/P2 - you can use our own PrinterToPDF (public domain convertor)

If it is ESC/POS or a Windows printer driver, then you will need to write a conversion routine

Return to “Other projects”