WLH
Posts: 1
Joined: Thu Jul 18, 2019 5:09 pm

RPi as virtual PDF printer hooked up throughout USB ?

Thu Jul 18, 2019 6:10 pm

Dear all,

I’ve been looking in several places to find an answer, but as I am not finding it, I fear a simple solution won’t be possible ....

I am thinking about setting up the RPi as a Print to PDF system.
I have several computers (interrogation programmers for cardiac devices) which print their interrogation data on built-in thermal printers, producing a massive amount of paper.
All of these computers are able to connect to an external USB printer. The only variable I can change is the printer driver.
An alternative possibility is to have these devices produce a pdf which they can save on a USB stick.

Is there a possibility to hook the RPi up to these computers through USB (one at a time off course) and have it capture the data sent to print to a PDF file.
Alternatively could it be possible to let the RPi function as a large USB stick and let the devices save their pdf file on the Pi. (I cannot change the location where the devices save their files (always root folder).

As the RPi helped me a lot with another (more simple) project (digital signage in waiting room) I was hoping to find a solution for this project.

Thanks for your thoughts.

User avatar
rpdom
Posts: 14767
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: RPi as virtual PDF printer hooked up throughout USB ?

Fri Jul 19, 2019 9:45 am

The Pi can print to PDF using the cups-dpf package, but the only ones that can be used as a USB device are the Zero range, the A models and possibly the Pi 4. Even so, I don't think any of them can emulate a printer via USB.

Over a network it should be easy.

Making a Pi Zero appear to be a USB storage device is possible. You'd need to define an area or file that is used for storage and wouldn't be able to access it while plugged in to USB, but with some reconfiguration it would be possible when removed from USB and rebooted.

Zanstel
Posts: 27
Joined: Thu Jul 18, 2019 9:05 am

Re: RPi as virtual PDF printer hooked up throughout USB ?

Fri Jul 19, 2019 10:12 am

I'm not sure what are you asking for, but the answer is YES.

Just a joke.

Well... If you want a printer to use by some devices, probably the easiest solution is to put a printer network services.
One could be a Windows printer, using Samba.

If you want to connect directly a RPi to a PC and see the RPi like a printer, I think it could be possible in the Raspberry Pi Zero (or Zero W), because it has USB OTG (On the Go). That's mean that the USB could be used to serve services, so the Raspberry could be shown like a massive storage, a ethernet, a serial, a keyboard or mouse, or a printer.

I don't try this ever. (In fact, I have some RPi but I don't have any Zero model), but technically, though the g_printer driver it should be possible to make a RPi Zero show as a printer.

The correct driver should be a standard one like a PostScript driver, so you can convert into a PDF easily.

hippy
Posts: 5610
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: RPi as virtual PDF printer hooked up throughout USB ?

Sat Jul 20, 2019 11:00 am

rpdom wrote:
Fri Jul 19, 2019 9:45 am
Even so, I don't think any of them can emulate a printer via USB.
It looks like it should be possible as there is a printer gadget ...

https://www.kernel.org/doc/Documentatio ... rinter.txt

In theory it should be possible to create gadgets which can do anything. In practice most users are limited to what others have already created and any limitations those implementations have.

User avatar
rpdom
Posts: 14767
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: RPi as virtual PDF printer hooked up throughout USB ?

Sat Jul 20, 2019 7:21 pm

hippy wrote:
Sat Jul 20, 2019 11:00 am
rpdom wrote:
Fri Jul 19, 2019 9:45 am
Even so, I don't think any of them can emulate a printer via USB.
It looks like it should be possible as there is a printer gadget ...

https://www.kernel.org/doc/Documentatio ... rinter.txt

In theory it should be possible to create gadgets which can do anything. In practice most users are limited to what others have already created and any limitations those implementations have.
Interesting.

Return to “Networking and servers”