Top
Best
New

Posted by cat-whisperer 12 hours ago

How to build a printer(nishantjosh.dev)
335 points | 67 comments
ValdikSS 8 hours ago|
>penguin would shrink the result to fit its screen. >I declared A5 and Letter paper, media type stationery, and an output bin called face-up.

You can (and should!) define exact dimensions of your screen in `media-size-supported`. It will probably be a non-standard IPP name, that's why you should define that in `media-supported` as `om_NNNmmxYYYmm` or `oe_NNNinxYYYin`

That way you don't need to scale the incoming data, the PC will format it exactly to the dimensions of the screen.

Both PWG Raster and Apple Raster support 1-bit-per-pixel mode (instead of 8-bit-per-pixel you use), that's why the input could be 8 times less in size. Use `print-color-mode-{supported,default}=bi-level` instead of `monochrome` for that. And also tune `urf-supported`'s `W` option, use `W1` for this case.

The screen/dithering could be ass in 1-bit mode, see https://github.com/OpenPrinting/libcupsfilters/pull/160 where I added more dithering options (Linux-only though, Apple seems to abandon their CUPS).

Neywiny 8 hours ago||
This is why I like it here. Somebody does irrefutably incredible work outside of their comfort zone, and somebody else goes "yeah actually I was born in that zone. Moulded by it. Here's how to improve it" (in a positive way)
ValdikSS 7 hours ago||
Oh no, I wasn't, and that's definitely not my comfort zone. I mess with the printers and printing stack due to anger, not because I like it.

It's bugs on bugs, with bugs chasing bugs! So little developers, so complex stack with 25 years of technical debt, and little community around because it's not a sexy technology to be involved in.

That's why I have to dive deep and fix my bugs myself if I want to make it work properly as I would like it to. I also ended up making my own print server device, because China did not make a proper one for some reason for all these years.

lopis 3 hours ago|||
Anger is the only valid emotion when dealing with printers.
edoceo 5 hours ago|||
That's even cooler
quijoteuniv 3 hours ago||
Same feeling when family or friends ask me for help with Micros word about formatting, tables or inserting pictures in the last 25 years….
darkvision77 2 hours ago|||
> Use `print-color-mode-{supported,default}=bi-level` instead of `monochrome` for that

The last time I checked (a year ago), 1bpp was suddenly supported only by Windows. IIRC, monochrome is REQUIRED, while bi-level is OPTIONAL in RFC.

Not sure how things stand now, though. Ever since then, I've just been carrying Floyd–Steinberg dithering around.

cat-whisperer 8 hours ago||
lovely, this would save me a bunch of memory during transformation and dithering. Will do!
alternativeworl 8 hours ago||
Very cool. I was expecting to learn about the ins and outs of ink, printheads etc but instead learned "How to build a paper that acts like a printer" which turned out much more entertaining.
a3w 20 minutes ago||
Wanted ideas on how to build an ink printer that is untraceable. For privacy reasons.
cat-whisperer 7 hours ago||
glad you liked it!
tapia 4 hours ago||
In Linux it's pretty easy to create such things with cups. A while ago I did a cups backend for my Fujitsu Quaderno A4 [1]. It is super useful to be able to just open any document, in any program that supports printing, and then just "print" it to my device.

[1] https://github.com/cristobaltapia/dpt-rp1-cups

IdiotSavage 4 hours ago|
> any program that supports printing

Unfortunately printing support seems to go out of fashion, at least in macOS land.

Lately I needed a quick printout of a markdown document. I could have used TextEdit for the raw text, but I wanted the styling too. Learned that neither VSCode, Xcode nor Obsidian can print. (There is a community plugin for Obsidian.)

rrr_oh_man 3 hours ago||
LOL. TIL you can’t print from VSCode.
maybewhenthesun 2 hours ago|||
printing has never really been a thing from text editors I think.

Used to be that printing a text file was just `cat myfile.txt > /dev/lp0` .

It has been a while since I printed a plain text file, but I guess there's still a similar command available with some research.

IdiotSavage 14 minutes ago||||
TextEdit.app supports printing, so does Notepad.exe (unless they removed that recently).
ptman 5 minutes ago||||
vim/nvim at least have :print
voidUpdate 1 hour ago|||
I've done the same from a raspberry pi to a receipt printer, just piping to lp0
simonjgreen 3 hours ago|||
Or Obsidian
kitd 2 hours ago||
Good article.

One of the great things about having an open platform like the Xteink is that it should uncover loads of novel and unsatisfied use cases. Eg, this could be paired with a mobile phone to act as a secondary display much better suited to outdoor applications in bright sunlight.

pimterry 1 hour ago||
This would be a neat API for a digital photo frame - just print photos to it and they appear on the screen.
cat-whisperer 1 hour ago|
yes!!
ks2048 9 hours ago||
Good job, but I’m left wanting to know how to build a printer.
tdeck 6 hours ago||
If a DIY plotter would do, this site has a long list of different projects

https://mattwidmann.net/notes/pen-plotters/

voxelghost 3 hours ago||
What if I want a cabinet sized rotating head printer that can print carbonpaper triplets, sounds a machinegun, and has LP0 ON FIRE error message
cat-whisperer 9 hours ago|||
I'd say it's an eco-friendly printer
d--b 5 hours ago||
There is an open source one https://www.opentools.studio
zxexz 2 hours ago||
How is that open source? There’s not a single line of code. No CAD. Nothing. Sure, there’s a “coming soon” CrowdSupply link, which I guess is more than a KickStarter. But open source?
d--b 1 hour ago||
Ah sorry, I thought they were already open source. They say they will open source it once they finalize the design, but yeah, not there yet.
e12e 5 hours ago||
Nice. I keep wondering if these devices would play nicer with DjVu rather than pdfs and raster formats?

https://djvu.sourceforge.net/

yeasin-arafat 2 hours ago||
Emulating a network printer to send pages to an e-ink screen is such a clever hack. Every OS already has the print dialog built in.
jiehong 3 hours ago||
Pretty cool work! And it’s nice to see printer discovery works through the standard mDNS!

Regarding the size of the page being sent to the printer, I remember reading that printers used to be postscript interpreters and the result of that program would be the page.

Perhaps that would trade ram for compute, but might be more complex in the end.

jarboot 10 hours ago|
This is amazing!!! It just makes sense. And its just how you would want to use a e reader.
cat-whisperer 10 hours ago|
if it looks like a paper, it should act like a paper
nomel 10 hours ago||
You can even fold it, once!
cat-whisperer 9 hours ago||
It's also not effective against rock
valleyer 9 hours ago||
Funny. But... paper covers rock.
sudo_cowsay 9 hours ago||
Jan Ken Po!
More comments...