frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Writing your own CUPS printer driver in 100 lines of Python (2018)

https://behind.pretix.eu/2018/01/20/cups-driver/
111•todsacerdoti•6h ago

Comments

roywashere•4h ago
Pretix is a very interesting piece of open source software for selling event tickets. It’s nice to see them venturing out to writing printer drivers for ticket printers! All the best for them.
behnamoh•4h ago
https://gimp-print.sourceforge.io/ which uses CUPS helped me resurrect an old Canon printer for which the company refused to provide updated drivers on macOS.

I was about to throw it in the recycling/trash, but I just couldn't accept that a perfectly fine hardware was crippled because the software was not updated to work on the latest macOS versions. Perplexity pointed me to Gutenprint and it worked wonderfully! The only thing that doesn't work is the scanner functionality.

asveikau•3h ago
Many years ago I remember Windows support vanished on a bunch of printers at the 32 to 64 bit transition. That was around the time I learned how printing on Linux and BSD worked, to save a printer or two.
LargoLasskhyfv•1h ago
Did you try http://sane-project.org for the scanner part? They have support for some Canons, maybe you're lucky?
saltcured•3h ago
This takes me waaaaaaaay back to when I did my first bit of practical low-level programming. I wrote a little C program that translated PNM bitmaps into the wire format for my dusty 24-pin Epson dot matrix printer. I don't remember the details, but I used it with some plugin system involving Ghostview to print postscript documents from my first Linux system in the early 90s.
whycome•2h ago
Is there an LLM specifically for this use case scenario?
a-ungurianu•1h ago
I’m not clear what you’re asking with this question.

Do you mean a LLM to write printer drivers? For that I think any of the coding LLMs should be able to help

Or do you mean using an LLM to do the raster -> FGL format translation? While I’m sure it might be possible, feels like an awful waste of resources, and when it comes to printers, you kinda want the guarantee that what comes out is the same that comes in.

userbinator•2h ago
However, the license of the BOCA driver forbids using their driver to control printers of other vendors.

Since this is a printer, I interpret those the same way as "you're not allowed to use third-party ink": I don't care.

ale42•36m ago
Personally, I don't either. But if you're a business, you probably need to care even if you don't want to.
ValdikSS•14m ago
Oh!

Take a look at EPSON printer driver, which prohibits you from:

1. Sharing the printer you own with anyone else unless they agree to the license of the driver (incl. business setup)

2. Sharing the printer over the internet unconditionally, because this allows to use the driver for people who did not agree to the license

3. Incorporating the driver in any "revenue generating product or service"

https://download.ebz.epson.net/la/linux/inkjet_for_linux.htm...

1. Grant of License.

[…] provided that the Software is used (i) only in a single location (e.g., a home or office or place of business), or in the case of a mobile device, on a Device owned or otherwise controlled by you, and (ii) only in connection with Epson Hardware owned by you. You may allow other users of the Epson Hardware connected to your network to use the Software, provided that you shall ensure that such users use the Software only in accordance with this Agreement. You agree to be responsible for and indemnify Epson for liabilities incurred as a consequence of use by such users.

3. Other Rights and Limitations.

[…] Further, you agree not to place the Software onto or into a shared environment accessible via a public network such as the Internet or otherwise accessible by others outside the single location referred to in Section 1 above.

You may not rent, lease, distribute, lend the Software to third parties or incorporate the Software into a revenue generating product or service.

ValdikSS•9m ago
>Unfortunately, CUPS sends us grayscale values and our printer only supports pixels that are either fully black or white. Since we do not want to drop grayscale values compeltely, we want to apply Dither.

CUPS can send black-and-white 1 bit data, dithered. It's just a matter of proper option in a PPD file. It could also handle rotation by itself.

Other than that, pretty good and accurate article! I bet you can write the driver (filter) even in <50 lines of Python code :P

Plwm – An X11 window manager written in Prolog

https://github.com/Seeker04/plwm
103•jedeusus•4h ago•15 comments

Ask HN: What are you working on? (May 2025)

47•david927•2h ago•146 comments

Lottie is an open format for animated vector graphics

https://lottie.github.io/
217•marcodiego•7h ago•94 comments

Path to a free self-taught education in Computer Science

https://github.com/ossu/computer-science
111•saikatsg•4h ago•59 comments

Writing your own CUPS printer driver in 100 lines of Python (2018)

https://behind.pretix.eu/2018/01/20/cups-driver/
111•todsacerdoti•6h ago•11 comments

Lisping at JPL (2002)

https://flownet.com/gat/jpl-lisp.html
80•adityaathalye•3d ago•19 comments

Claude 4 System Card

https://simonwillison.net/2025/May/25/claude-4-system-card/
501•pvg•15h ago•201 comments

Writing a Self-Mutating x86_64 C Program (2013)

https://ephemeral.cx/2013/12/writing-a-self-mutating-x86_64-c-program/
56•kepler471•4h ago•19 comments

Design Pressure: The Invisible Hand That Shapes Your Code

https://hynek.me/talks/design-pressure/
111•NeutralForest•8h ago•29 comments

Koog, a Kotlin-based framework to build and run Al agents in idiomatic Kotlin

https://github.com/JetBrains/koog
20•prof18•3d ago•0 comments

Show HN: Zli – A Batteries-Included CLI Framework for Zig

https://github.com/xcaeser/zli
43•caeser•5h ago•14 comments

Show HN: DaedalOS – Desktop Environment in the Browser

https://github.com/DustinBrett/daedalOS
84•DustinBrett•5h ago•18 comments

Denmark to raise retirement age to 70

https://www.telegraph.co.uk/world-news/2025/05/23/denmark-raise-retirement-age-70/
201•wslh•5h ago•477 comments

CAPTCHAs are over (in ticketing)

https://behind.pretix.eu/2025/05/23/captchas-are-over/
80•pabs3•21h ago•92 comments

Martin (YC S23) Is Hiring Founding AI/Product Engineers to Build a Better Siri

https://www.ycombinator.com/companies/martin/jobs
1•darweenist•4h ago

Wrench Attacks: Physical attacks targeting cryptocurrency users (2024) [pdf]

https://drops.dagstuhl.de/storage/00lipics/lipics-vol316-aft2024/LIPIcs.AFT.2024.24/LIPIcs.AFT.2024.24.pdf
81•pulisse•10h ago•60 comments

'Strange metals' point to a whole new way to understand electricity

https://www.science.org/content/article/strange-metals-point-whole-new-way-understand-electricity
83•pseudolus•7h ago•26 comments

Can a corporation be pardoned?

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5202339
40•megamike•5h ago•59 comments

Is TfL losing the battle against heat on the Victoria line?

https://www.swlondoner.co.uk/news/16052025-is-tfl-losing-the-battle-against-heat-on-the-victoria-line
59•zeristor•12h ago•87 comments

Tariffs in American History

https://imprimis.hillsdale.edu/tariffs-in-american-history/
60•smitty1e•1d ago•92 comments

Show HN: SVG Animation Software

https://expressive.app/expressive-animator/
152•msarca•10h ago•70 comments

Trading with Claude (and writing your own MCP server)

https://dangelov.com/blog/trading-with-claude/
7•dangelov•3d ago•1 comments

On File Formats

https://solhsa.com/oldernews2025.html#ON-FILE-FORMATS
101•ibobev•4d ago•67 comments

Dependency injection frameworks add confusion

http://rednafi.com/go/di_frameworks_bleh/
85•ingve•14h ago•96 comments

What happens after you run Git push?

https://www.blacksmith.sh/blog/security
7•tsaifu•2d ago•1 comments

Now you can watch the Internet Archive preserve documents in real time

https://www.theverge.com/news/672682/internet-archive-microfiche-lo-fi-beats-channel
101•LorenDB•2d ago•9 comments

Programming on 34 Keys (2022)

https://oppi.li/posts/programming_on_34_keys/
50•todsacerdoti•9h ago•68 comments

Show HN: AI Baby Monitor – local Video-LLM that beeps when safety rules break

https://github.com/zeenolife/ai-baby-monitor
68•zeenolife•4d ago•49 comments

Show HN: Wall Go – browser remake of a Devil's Plan 2 mini-game

https://schaoss.github.io/wall-go/
24•sychu•7h ago•8 comments

The Newark airport crisis

https://www.theverge.com/planes/673462/newark-airport-delay-air-traffic-control-tracon-radar
94•01-_-•4h ago•74 comments