How to build a printer(nishantjosh.dev) |
How to build a printer(nishantjosh.dev) |
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).
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.
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.
just put a pen or sharpie on the same mechanism, no?
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.
+1.
And it's worth celebrating the underlying technologies that enable this: ESP32, and RISC-V.
Anyone know what's needed for eink to become cheaper?
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.)
How is "offline e-reader" handled? Does CUPS retry?
Do you do this outside of your LAN?
Inkjet is quite difficult but dot matrix printers are easier to find DIY projects of.
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.
I think the nice b/w no-flicker fade transitions chop the transitioning of all changing pixels into small burst/chunks and interleave/alternate the chunks of white-to-black with the chunks of black-to-white, so it's perceptually simultaneous. Or it's actually pulling off some kind of tri-state driving leaving unchanging pixels alone and pulling those that change to either plus or minus polarity depending on what transition direction they are supposed to go in... Sadly IIRC all quite proprietary-gated :(
What that means for djvu is that at least for text-only content on those readers that manage the 300 dpi "threshold" you'd just rasterize to pure 300dpi black/white (1 bit per pixel) comparable to a 300dpi "don't skimp on toner but don't you dare take half a second longer than you must in order to make the text crisp enough for $reader to have no good reason to whine about it being not crisp enough" laser printer job.
Djvu is particularly for displays with more than about 5bits of grayscale as well as for lossy compression of grayscale/color scans. And maybe also some efficiency gains on 1-bit-per-pixel quantized scans, but those aren't usually the target content for these readers, IMO. Might want to try for them, though!
Fwiw google Gemini cane up with the following to convert pdfs on device in termux after some prodding (koreader can display DjVu):
You'll need access to storage:
termux-setup-storage
Then pipe/paste this to a script: (Sorry for the verbose slop)
Ed: moved to sibling comment
If you like e-ink device reviews this is an artsy channel think small leather notebooks https://www.youtube.com/watch?v=-oOqFUuULOk
For me my favorite is the RM2 but I keep selling/buying it back due to poor financial decisions but I love how it writes and long battery, plus hackable, never paid for a subscription. It is an extra device too so unfortunately not used that often I spend most of my time in front of a desktop but have multiple laptops too/drawing tablets.
Just open pdf on mac, hit print, grab a kindle and there it is (yes, I know, we can do send to kindle, and some time later, when Jeff Bezos allows so, the doc might appear).
- 4 font formats
- 9 image formats
- blending with transparency
- different colorspaces, each image could use its own on the page
- different dithering algorithms, each image with its own
- the page can have elements from another pages (global elements)
This is only a small part from the top of my head.Common simple home printers absolutely should not accept regular PDF as an input: thanks to Apple and IETF we now have Apple Raster and PWG Raster for printers, as a part of AirPrint and IPP Everywhere/Mopria driverless printing standards, which are very similar but have slightly different options and headers. It's a simple raster input for printers specifically.
Some companies, such as HP, invented a "raster PDF": PCLm / PCLms. Don't be confused by the name, it's a regular standard-conforming PDF which contain nothing but a full-page JPEG on each page, and don't use any other features. It's created only to be able to open "printed page" (driver output) in a standard PDF viewer on a PC for debugging or business logging needs, but otherwise it's like a regular JPEG with additional per-page metadata.
Kindles have a ton of RAM, this one didn't.
The author "prints" to the eink display. Why not load say the pdf directly?
I'm not going to create a recipe PDF and load it on an e-reader. That's too much work. But I will happily press control-P on a recipe web page and select the eink display as the target.
I wonder now what else we've reinvented when it comes to sending data...
> But getting stuff onto it was tedious. I had to join its hotspot and open a little upload website in my browser. Yuck.
Anyway, very creative, I like the idea a lot.
> Kindles have a ton of RAM, this one didn't.
I often do 'print to A5 pdf => copy pdf to e-reader'. Would be nice to do that in one step from any program that can print.
I see that it applies styles to markdown documents, but keeps all formatting characters visible (e.g. # for titles). I guess I wasn't happy with that and looked for another solution.
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.
It's always been a thing: We programmed on paper before we had screen editors, and so early screen editors have always had a way to murder trees on demand:
In vi it's :ha
In emacs it's M-x print-buffer
> 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.
`lp myfile.txt`
I still prefer using hardcopy for reading/debugging.
Since then printers progressively forgot how to cope with such "documents", though IIRC good-old HP "PCL" should only require about a bare minimum of framing/job control to get a modern printer to handle ASCII plain text.
there's literally ctrl+p shortcut for printing
This one seems to work well: pdconsec.vscode-print
Link: https://marketplace.visualstudio.com/items?itemName=pdconsec...
Then just map the resulting 16 brightness levels according to the contrast ratios/progression they have on your eink. Use phone camera and adjust whole image contrast/brightness/black-intensity sliders holding them side by side until the grayscale matches.
Then just pick pixel RGBs from a gray-bars test image you have opened on the remarkable before you took the picture with your pixel 7 pro. Might not easily be done on the phone but can let a python using AI grab those for you. (If it's wrong it'll be obvious or so harmless it doesn't matter anyways.)
Then you take that rasterized-to-1/4-bpp-djvu apply the color palette you just built yourself, and zoom to 300dpi.
Other than the screen backlight which you've taken care of when you held both devices side-by-side and played with the sliders, there's no substantial difference left. Should be pretty representative. Don't look with too much of a magnifying glass though the phone doesn't have exactly the same dpi so there are resampling artifacts your eyes resolve if you're too close to it.
check page 3. even I was surprised