Web printing
fedilink

Hi!

I have setup ScanServJS which is an awesome web page that access your scanner and let you scan and download the scanned pages from your self hosted web server. I have the scanner configured via sane locally on the server and now I can scan via web from whatever device (phone, laptop, tablet, whatever) with the same consistent web interface for everyone. No need to configure drivers anywhere else.

I want to do the same with printing. On my server, the printer is already configured using CUPS, and I can print from Linux laptops via shared cups printer. But that require a setup anyway, and while I could make it work for phones and tablets, I want to avoid that

I would like to setup a nice web page, like for the scanner, where the users no matter the device they use, can upload files and print them. Without installing nor configuring anything on their devices.

Is there anything that I can self-host to this end?

Gotta say, this question and the process explained threw me for a loop.

You have a network print server where it’s advertising an available printer, but instead of the native printer system on a client device, you want to NOT use the CUPS server to print? That’s what it’s there for. I’m confused on why you have it then.

If your goal is just to have clients print as directly as possible to a printer…you already have that with CUPS running. I guess I’m not getting why submitting via web form is useful in this case.

Shimitar
creator
link
fedilink
English
32M

I want to print from a web page: upload the file, hit print button.

In this way I can print from whatever device I want even without any driver installed or configuration.

CUPS already does this though, and that’s where I’m getting confused. This is the entire point of CUPS. If your issue is with drivers, then you need to configure it to just print from its own driver via a spooled queue like PostScript, or maybe IPP.

https://wiki.archlinux.org/title/CUPS/Printer_sharing

Shimitar
creator
link
fedilink
English
52M

I known cups can share printers and queues.

What is unclear?

I don’t want to pull drivers or install cups on devices. I want to print from anywhere just uploading a file to a web page.

If I have lots of devices or just want to let somebody print from his phone/tablet without installing or configuring anything…

With cups I still need to touch the system or the device somehow to let it print.

lemmyvore
link
fedilink
English
2
edit-2
2M

You don’t have to install drivers or CUPS on client devices. Linux and Android support IPP out of the box. Just make sure your CUPS on the server is multicasting to the LAN.

You may need to install Avahi on the server if it’s not already (that’s what does the actual multicasting). The printer(s) should then auto magically appear in the print dialogs on apps on Linux clients and in the printer service on Android.

On Linux it may take a few seconds to appear after you turn it on and may not appear when it’s off. On Android it shows up anyways as long as the CUPS server is on.

I am saying that CUPS requires zero drivers or anything else from clients. It advertises the printer on the network, a device sees it, and submits a job. That’s it. Exactly what you are describing doing with a web form, except CUPS already does all of this.

Sounds like you’re not sure how it works.

Shimitar
creator
link
fedilink
English
32M

It still requires the device to be capable to print…

And the user to find the printer select it and so on. And must expose more ports on the network beside 443…

So, indeed cups is a great solution, but not to the problem I want to solve.

I do use cups in fact for the trusted part of the network, driverless printing for windows and Linux. Android doesn’t even need cups since it picks up the printer directly from the printer itself (AirPrint or whatevee that’s called).

Just going to say it again: IPP (Internet Printing Protocol) via CUPS solves for all of this, but you seem destined for a specific thing you want to do and don’t actually need help with your current issues, so not sure why you posted here.

Shimitar
creator
link
fedilink
English
22M

Ok, I have a web browser on a locked down device and nothing else: how do I print a pdf or a photo using IPP?

I have: a camera, a browser, a file manager (kind of, think of an iPhone or some stock android business device) and I need to print a photo taken with the camera or a pdf file sent to me via email or WhatsApp?

The device is connected to the WiFi guest network with limited internet access (if any) and as only available service a server with port 443 open (a reverse proxy on that, captive portal and such).

In my experience, there is no way to print via cups in this configuration. Maybe I am wrong?

Magiilaro
link
fedilink
English
12M

Sounds like you want savapage https://www.savapage.org/

It by default runs on its own port but that is easy fixable with a reverse proxy.

@ravhall@discuss.online
link
fedilink
English
22M

Just have a web form post a printable file and have the back end use lpr? Are you able to write code for PHP or nodejs?

Shimitar
creator
link
fedilink
English
22M

Yes, sure I am… Would probably prefer a bash CGI because I like challenges :)

(Author and such would be managed by my reverse proxy)

But I would prefer something already baked if it exist

@Moonrise2473@feddit.it
link
fedilink
English
42M

I made something crude with python and flask, but it’s only to print address labels, always the same settings (paper size and so on)

So i just put a textbox, press the button and it prints there.

When printing generic stuff, you would need to set paper type, paper size, color or BW, if have both sides printed, if printing from a specific tray, then some kind of user authentication (i am lazy and i didn’t care about privacy so i used cloudflare access), so the complexity becomes much bigger.

Before making my crude script I searched long time for a free or cheap solution, but I didn’t find. If you find, let me know

Shimitar
creator
link
fedilink
English
12M

Yes, this is what I am afraid of… There is nothing out there for this task.

Hope to find something or maybe try to create something using lpr on the background… But this is the las hope as I have little time.

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 124 users / day
  • 419 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog