Emulated_USB_Printer icon indicating copy to clipboard operation
Emulated_USB_Printer copied to clipboard

Emulated Printer Working, Output Not So Sure

Open JIGR1969 opened this issue 1 year ago • 1 comments

I have followed all of the steps within this guide and have a printer emulated and working, that is to say, it's storing data in the "printjob" directory, however, I'm not sure as to what printer language the printer is outputting. It should be outputting ESC/POS but it certainly does not look like it is based upon the contents of the files.

I know within the "modprobe" command, there is a parameter called "iPNPString" which details the printer, and within that parameter, there is the "CMD:" option, which in all intentions, looks like the type of output the printer can accept. Even with removing this option/parameter, or setting it to "TXT01", the output file still looks encoded in some respect.

Using the GhostPDL to get output in PDF format isn't generating any meaningful files, just the same encoded file within the PDF.

The question is, how can I simply get the raw output destined for the printer into a file and if that cannot be done, does anyone know what printer language the attached file is in.

Kind Regards James 2023-12-04-11-29-53.txt

JIGR1969 avatar Dec 04 '23 13:12 JIGR1969

Hey James, glad to to hear the emulated printer itself is working! If possible, please share your modprobe command including the iPNPString you are using. When I was doing my research, the modprobe command was really only important for the USB Host (the PC you connect your Pi to) to detect the correct printer model and load the correct drivers accordingly. Changing any settings within the iPNPString never had an effect on the print job results. So once the USB Host recognizes the Printer Model it loads the USB Driver it knows. The USB Driver then determines the Output sent to the Pi. I would suggest doing some research on the Printer Model, look a manuals, check if you find something about the PDL the printer model uses.

Also, I found GhostPDL to work only for very, very, very specific printer models. So I am not surprised to hear it does not work out of the box. However, there are many other OpenSource tools you can use to get it parsed.

To get the raw byte data, you might want to have a look at printer_minimal.c which you can find in this repo, this should do the trick :)

As always, I am excited about any feedback and (even better) positive feedback!

Raspberryy avatar Dec 04 '23 21:12 Raspberryy