Login
You're viewing the techdon.dev public feed.
  • Sep 3, 2026, 9:10 PM

    Hey @till random question:

    I'm thinking about printer test pages. I was wondering if we could have CUPS actually execute a little program that dynamically generates the test page. This way we can have nice translations and fonts and page-size-aware layout

    I _think_ we could just use a dummy test page that has some recognizable byte string, register it as a special mime type w/ CUPS, and then build a custom filter that gets executed to spit out the PDF

    Is something like this built in?

    💬 3🔄 2⭐ 3

Replies

  • Sep 3, 2026, 9:12 PM

    @till (also, I'm not sure if this filter stack is all going away with the next-gen CUPS stuff? Or staying? It's not super clear that my filter solution would remain functional long-term?)

    💬 1🔄 1⭐ 1
  • Sep 3, 2026, 10:01 PM

    @AdrianVovk

    Yes, CUPS 3.x would be a problem here as it drops the filter concept. It goes strictly all-IPP and so it seems to not have any support for plugin executables, like the old CUPS' filter/backend concept.

    CUPS comes with one additional executable to do the filter work, but it is only separate to run as unprivileged user and to not make CUPS crash when the filter executable crashes.

    The conversions are pre-defined by CUPS, as we only need the formats of ...

    #OpenPrinting

    💬 1🔄 0⭐ 0
  • Sep 3, 2026, 10:02 PM

    @AdrianVovk

    ... driverless IPP printing (AirPrint, Mopria, IPP Everywhere, Wi-Fi Direct Print), and they are PDF, Apple Raster, PWG Raster, and PCLm.

    Input formats are limited to well-known formats, especially the standard input format PDF but also plain text, images, ...

    I do not know what Michael Sweet's idea for a test page is. ...

    #OpenPrinting

    💬 1🔄 0⭐ 0
  • Sep 3, 2026, 10:08 PM

    @AdrianVovk

    ... So as it seems that CUPS 3.x has not this powerful plugin filter and so also test page concept any more, we need now ask the developers of printer setup tools, currently
    - GNOME Control Center
    - KDE Print Manager
    - COSMIC Printers (in Settings and stand-alone)
    - system-config-printer

    to build a (branded) test page generator into their tools.

    Or we build it into the XDG Desktop Portal, that printing some kind of command file (or a dedicated API call) ...

    #OpenPrinting

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Sep 4, 2026, 1:02 AM

    @till If CUPS 3 doesn't have a solution for generating test pages within CUPS, and is instead going to rely on the Settings app to generate these test pages, then perhaps we need to switch to that even for older CUPS versions.

    I think letting the desktop figure out what to print seems like a good idea. Then the desktop could apply settings from the user session (like language) as well, and style a test page that fits in with its design.

    Thanks for the context!

    💬 0🔄 0⭐ 0
  • 💬 1🔄 1⭐ 0
  • Sep 3, 2026, 11:13 PM

    @nw8man @AdrianVovk

    First, it is not PRN or COM, this was MS-DoS, and as this DoS is already solved by replacing the system by Linux, we have some /dev/... files which could take data directly to a printer:
    - /dev/usblpX
    - /dev/lpX

    X = 0, 1, 2, ...

    At least they are there if the appropriate kernel module is loaded and the appropriate connectivity hardware (parallel port, USB) is there.

    USB is there but as CUPS does not use the usblp kernel module, the module is not ...

    #OpenPrinting

    💬 1🔄 0⭐ 0
  • Sep 3, 2026, 11:19 PM

    @nw8man @AdrianVovk

    ... loaded (it would be even in the way for CUPS to access printers).

    So in the modern world of CUPS and not having parallel printers, throwing unfiltered data directly at the printer works with CUPS:

    lp -d PRINTER -o raw FILE

    Here the queues PPD gets ignored and the data just passed through.

    For network printers you can also often use:

    nc -w1 HOST 9100 < FILE

    #OpenPrinting

    💬 0🔄 0⭐ 0
  • Sep 3, 2026, 9:41 PM

    @AdrianVovk Yes, this would work. The bannertopdf filter also works that way. It is a a program generating a banner page, and also the current test page. It is, as you say triggered by a special MIME type, but the input file does not only contain the magic string to get identified as this MIME type, but also some parameters.

    We can modify bannertopdf to make a better test page, or even add a "testpage" filter dedicated for that purpose. And as each filter has access to the ...

    #OpenPrinting

    💬 1🔄 0⭐ 0
  • Sep 3, 2026, 9:46 PM

    @AdrianVovk

    ... printer's capabilities via the PPD file, these properties can be included in the test page, as we see in the original one.

    Also, the filter can, as you say, generate arbitrary graphics and output them as PDF. No problem. A library like PDFio could help for the generation of the complex PDF file format, see the other filters in the current libcupsfilters.

    Each desktop environment or distro could provide their own test page "filter" for branding.

    #OpenPrinting

    💬 0🔄 0⭐ 0