Printing
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
Stuart Painting (5389) 714 posts |
Some Netgear routers (e.g. the Nighthawk AC1900 model D7000v2) allow a USB printer to be shared. This is done using a proprietary mechanism (ReadySHARE) and each computer still needs the appropriate USB printer driver as well as the ReadySHARE software. In short, not that interesting for our purposes. |
Rick Murray (539) 13840 posts |
Ditto. The thing is, if you read the information, you’ll find there are many holes and deficiencies. I do not envisable a big problem in supporting “IPP Everywhere” as that’s an open specification. I have here in my hand a technical specification of the SPL2 language (QPDL), written by Aurélien Croc and translated into English. It seems to be fairly similar to URF, in being a banded bitmap. There may be enough here to attempt something (for a far more limited range of devices), but again as it is the result of reverse engineering, there are omissions – the second entry in the header notes that it is the resolution divided by 100, and then states “(horizontal or vertical?)” afterwards. And there are numerous fields whose value is unknown but here’s what it always seems to be… And this is just talking to the printer. The next section of the amusement park is dealing with printer drivers. The method that I used was to use SPrinter to turn the output into a bitmap, and then have a little program to go through the bitmap pixel by pixel to create something for the printer. Which, ultimately, did not work and was really slow (even being written in C).
Having some information is very different to having an implementation. Note, by the way, that I’m not that interested (at this time) in supporting IPP. My interest is in getting a page from Ovation to appear on my printer. I don’t see much point in doing anything else until some form of output can be generated.
It appears to accept raw data, so I would imagine it’s basically a pass-through and you’ll still need whatever sort of driver on the PC in order to create the expected sort of data. The router isn’t so much a printer server as an “invisible wire” between your computer and the printer. <clicky><clicky><rummage> Yes – you need to connect your printer to each computer in turn so it can load it’s drivers onto the computer. Info (in French). Then you plug the printer into the Livebox and on the PC, add a new printer as a wireless device. Info (in French). So, yeah, it’s just acting as an invisible wire so won’t be particularly useful to us. |
Rick Murray (539) 13840 posts |
RISC OS IPP driver on SourceForge… …with no files!? |
Doug Webb (190) 1180 posts |
Wayback is your friend or in this case the one you didn’t want to turn up as it seems only a non source pre built/non 32 bit module is avilable at version 1.04. |
Steffen Huber (91) 1953 posts |
Replying to myself…a description of an experiment on how to spend a few hours stumbling through unknown territory.
So from my point of view, IPP printing is considered a solved problem, it is now just the details like doing it from RISC OS and supporting formats beyond PDF for the more standard printers :-) |
Steve Pampling (1551) 8170 posts |
For a proof of concept the RO end would surely just1 require a download of the Dave Lambley module and a replacement of the 26-bit elements (likely to be simply exits with ^) and send some data to an IPP device. 1 Saying just of course is pretty glib but sometimes it is simply a quick cleanup. |
Steffen Huber (91) 1953 posts |
Having had a quick lock at the module – it does not do much. So an equally good proof of concept would be to do an HTTP connection and send some known-good payload data. I could supply that. Unless the module sources surface, we get to know under which licence the source lives and it is liberal enough, and someone would take over development of a module written in Assembler, it does not make much sense to take that module as a starting point. For simple printing, extending one of the remote printing modules would probably be straightforward. |
Rick Murray (539) 13840 posts |
I am so happy. :-) ☺ I started this morning by writing a program to convert a laserjet raster file to sprite. It wasn’t actually that hard. Then I rummaged around on my desk and dug up the unofficial specification of QPDL raster data and ran into a brick wall when it came to the compression part. Basically, it read like gibberish to me. I had an example created with the printer driver on Windows (and saved to file) and it had a number of PJL commands in there. So, just for the sake of playing around, I tried to set the language to PCL and write out a text message. The rest of the day was taken cobbling all of this into a program, and refining it to work reliably. [link removed – see later post] If you want to test this, here’s what you need to do:
If it all went right for you, then be happy that you can now print from RISC OS to a newish laser printer. If it went wrong, there should have been either a message on screen or some sort of reply from the printer. If there was a message, check the obvious like if port 9100 is open and available. If the printer did nothing, flashed some sort of error, or starting spitting out pages of junk, then there’s a good chance your printer does not support PCL.
|
Rick Murray (539) 13840 posts |
A slightly later version of SammyPrint (my IPP WiFi laser printer dodah), some information on what I did, and installation instructions are on my blog: https://heyrick.eu/blog/index.php?diary=20190729 If you try this on a WiFi capable mono laser printer, please let me know how you get on. I can say, for now: Works with:
|
Steffen Huber (91) 1953 posts |
Do you intend to take it further, Rick? E.g. sending the data via IPP instead of to the raw port? |
Dave Higton (1515) 3526 posts |
Hang on, Rick. That means you’ve transferred the stream to the printer using the JetDirect protocol. No wonder it accepts PCL. Please correct me if I’m wrong, but… it’s my understanding that IPP Everywhere etc. transfer the print data stream via IPP, which uses HTTP. As I understand it, all you’ve used IPP for is to find a printer and interrogate it for its capabilities. |
Steffen Huber (91) 1953 posts |
When JetDirect was invented by HP for laser printers, this connection was certainly the truth, but nowadays it is usually called “AppSocket prototcol”, is HP-independent (because it was always direct-raw-socket stuff) and is supported by all kinds of printers without PCL capability.
That’s also what I understand, but it is a very good first step. |
Rick Murray (539) 13840 posts |
Maybe some command line options for fine tuning, but otherwise probably not.
Tell that to my HP inkjet. You’d have thought the printer to support a common HP protocol would be the HP printer, right? <sigh> Note also from the blog post (big Zap window) that the Samsung Windows driver sends QPDL in that same manner. You’ll also find many printer drivers (Windows and Android) will attempt to use a “raw” connection (may be configurable to LPR or IPP). It’s JetDirect to printers that support JetDirect. It’s “raw” to everything else. Depending on the printer, it may support PCL, PostScript, HPGL, JPEG, or some sort of proprietary thing. If there is sort of PJL then you ought to be able to select what “language” is supported. If there is no PJL, then it’s probably fixed to be specifically what the printer wants (I believe the inkjet uses PCL3GUI).
Correct. Also allows access control, which raw typically doesn’t.
HTTP-like with a binary payload. The mechanism will be familiar to anybody who has ever written a web fetcher of any sort.
Correct. To determine if it can be used. Then I send PJL to raw to get it to switch to PCL mode (which the user guide says the printer does not support!) and send the data. Why? Because that works. It may be that IPP only supports QPDL and URF encoding. Like I said, this is what works. And if PJL/PCL is indeed fairly common, then RISC OS can now print to a number of devices, right? ;-) |
Steffen Huber (91) 1953 posts |
I cannot believe that there are printers supporting one data format over one transport and different data format over another transport. However, I could also not believe that a printer supports PCL if its data sheet does not say so, so what do I know :-) A happy accident for you, Rick – probably Samsung hasn’t paid the PCL licence fee to HP…just remember to never update its firmware, those “accidents” sometimes get corrected. |
Rick Murray (539) 13840 posts |
Indeed. Updated SammyPrint. Don’t have time to discuss it right now, so here’s the help message: *SammyPrint -? Syntax: SammyPrint [-colour] [-file <filename>] [-ip <addr>] [-nopreamble] [-verbose] -colour to allow colour printers to be accepted in network scan -file <f> to use a file other than <Wimp$ScrapDir>.LJ6data. -ip <addr> is an IP address of a printer, device will NOT be checked for compatibility first. -nopreamble to send data verbatim, without PJL setup. -verbose to be talkative (best used in a TaskWindow) Examples: To print a LaserJet 6 output to a Samsung M2022W laser printer: SammyPrint To do likewise, but specify the printer: SammyPrint -ip 192.168.1.24 To send "$.kittens.jpeg" to an HP3630 inkjet: SammyPrint -colour -file "$.kittens/jpeg" -nopreamble -verbose (this may work also for PDFs or PostScript if supported by the printer) This is SammyPrint version 0.02 (30th July 2019) by Rick Murray. Please refer to ht tps://heyrick.eu/blog/index.php?diary=20190729 * Note that my HP inkjet accepted (and completely ignored) the PCL data. However, with no preamble, I sent it a JPEG and it printed that scaled to fill the page. Not entirely useful for printing from RISC OS, mind you. ;-) Updated file on my blog page (link a few messages before this one). |
Steffen Huber (91) 1953 posts |
Did you use the “LaserJet” PCL thing? IIRC, it produces PCL5, and some inkjets only accept PCL3-with-colour-stuff or PCL-XL. IIRC, it’s been a long time… What does the inkjet respond to “getPrinterAttributes”? |
Rick Murray (539) 13840 posts |
I presume you mean this part? mimeMediaType : document-format-supported = "application/vnd.hp-PCL" mimeMediaType : (continued) "image/jpeg" mimeMediaType : (continued) "application/PCLm" mimeMediaType : (continued) "image/urf" mimeMediaType : (continued) "image/pwg-raster" mimeMediaType : (continued) "application/octet-stream" textWithoutLanguage : document-format-version-supported = "PCL3GUI" textWithoutLanguage : (continued) "PJL" textWithoutLanguage : (continued) "Automatic" textWithoutLanguage : (continued) "JPEG" textWithoutLanguage : (continued) "PCLM" textWithoutLanguage : (continued) "AppleRaster" textWithoutLanguage : (continued) "PWGRaster" So, then… PCL3GUI and PCLM, IPP PWG, Apple URF, and JPEG. But I’ll helpfully point out that the Samsung makes no mention at all of PCL. ;-)
Samsung no longer make printers. Shame. Guess who owns that stuff now… |
Rick Murray (539) 13840 posts |
The inkjet says it supports PJL. Not via the raw port, it doesn’t. I had much better luck talking to the Samsung, once I’d told Hearsay to send CRLF. :-) Make sure we’re in PJL mode and ask for configuration status: %-12345X@PJL INFO CONFIG IN TRAYS [1 ENUMERATED] INTRAY1 PAPERS [14 ENUMERATED] LETTER LEGAL A4 EXECUTIVE JISB5 ISOB5 NO10ENV MONARCHENV DLENV C5ENV FOLIO A5 CUSTOM OFICIO LANGUAGES [1 ENUMERATED] QPDL USTATUS [4 ENUMERATED] DEVICE JOB PAGE TIMED MEMORY=1348009 You will notice, of course, that there’s no mention of PCL in the languages section. ;-) Some other things: @PJL INFO CONFIG SERIAL NUMBER="xxxxxxxxxxxxxxx" @PJL INFO MEMORY TOTAL=1348008 LARGEST=1336925 @PJL INFO PAGECOUNT PAGECOUNT=1418 @PJL INFO STATUS CODE=35078 DISPLAY= ONLINE=TRUE FMU=NONE Since it appears to be a proper PJL parser, I asked it for settings information: @PJL INFO VARIABLES AUTOCONT=ON0SEC[3 ENUMERATED] OFF ON30SEC ON0SEC BINDING=OFF[5 ENUMERATED] OFF LONGEDGE SHORTEDGE REVERSE_LONGEDGE REVERSE_SHORTEDGE COPIES=1[2 RANGE] 1 999 CUSTOMSHORTEDGE=210[2 RANGE] 76 216 CUSTOMLONGEDGE=297[2 RANGE] 127 356 DENSITY=3[10 ENUMERATED] 1 2 3 4 5 6 7 8 9 10 DUPLEX=OFF[2 ENUMERATED] OFF ON ECONOMODE=OFF[2 ENUMERATED] OFF ON INTRAY1=UNLOCKED[2 ENUMERATED] UNLOCKED LOCKED INTRAY1SIZE=A4[37 ENUMERATED] LEGAL A4 EXECUTIVE JISB5 B5 COM10 MONARCH DL C5 POSTA6 C6 FOLIO A5 STATEMENT A6 LEDGER A3 JISB4 JPOST JPOSTD CUSTOM LETTERP A4P B5P A5P EXECP STSP A3OVER B5ENV OFICIO 634 USPOST INDEX B6 HAGAKI ODD B4 LANG=ENGLISH[1 ENUMERATED] ENGLISH MANUALFEED=OFF[2 ENUMERATED] OFF ON MEDIASOURCE=AUTO[2 ENUMERATED] DEFAULT TRAY1 MEDIATYPE=PLAIN[36 ENUMERATED] PLAIN NORMAL THICK THIN BOND COLOR CARDSTOCK LABELS OHP TRANSPARENCY ENVELOPE PRE-PRINTED RECYCLED USED LETTERHEAD SPECIAL PRINTED COTTON PAPERTYPE1 PUNCHED ARCHIVE PREPUNCHED PHOTO HEAVYWEIGHT HEAVY PERSONAL CHECK 3MDECAL Custom1 Custom2 Custom3 Custom4 Custom5 THICKER EXTRATHICK THICK_ENV THINCARDSTOCK ORIENTATION=PORTRAIT[2 ENUMERATED] PORTRAIT LANDSCAPE PAPER=A4[39 ENUMERATED] LETTER LEGAL A4 EXECUTIVE JISB5 B5 COM10 MONARCH DL C5 POSTA6 C6 FOLIO A5 STATEMENT A6 LEDGER A3 JISB4 JPOST JPOSTD CUSTOM LETTERP A4P B5P A5P EXECP STSP A3OVER B5ENV OFICIO 634 NO9 USPOST INDEX B6 HAGAKI ODD B4 PERSONALITY=AUTO[2 ENUMERATED] SMART QPDL POWERSAVE=ON[2 ENUMERATED] OFF ON POWERSAVETIME=1[2 RANGE] 1 120 RESOLUTION=600[5 ENUMERATED] 300 600 FAST1200 1200 200 TIMEOUT=15[2 RANGE] 5 300 TONERSAVE=OFF[2 ENUMERATED] OFF ON REPRINT=OFF[2 ENUMERATED] OFF ON LPARM:PCL FONTNUMBER=0[2 RANGE] 0 103 LPARM:PCL FONTSOURCE=I[2 ENUMERATED] I RFONT LPARM:PCL SYMSET=PC8[47 ENUMERATED] ROMAN8 DESKTOP ISOL1 ISOL2 ISOL5 ISOL6 MCTEXT MATH8 MSPUBL PIFONT PSMATH PSTEXT VNINTL VNMATH VNUS WIN30 WINL1 WINL2 WINL5 WINBALT SYMBOL WINGDING LEGAL ISO4 ISO6 ISO11 ISO15 ISO17 ISO21 ISO60 ISO69 PC775 PC1004 PC8 PC8DN PC850 PC852 PC8TK CYRILLIC CP866 GREEK ARABIC8 WINARABIC PC864 FARSI ISOARABIC PC8GREEK LPARM:PCL LINETERMINATION=0[4 ENUMERATED] 0 1 2 3 FORMLINES=64[2 RANGE] 5 128 WIDEA4=OFF[4 ENUMERATED] OFF ON NO YES OVERRIDEA4WITHLETTER=NO[2 ENUMERATED] NO YES LPARM:PCL PITCH=10.00[2 RANGE] 0.44 99.99 LPARM:PCL PTSIZE=12.00[2 RANGE] 4.00 999.75 COURIER=REGULAR[2 ENUMERATED] REGULAR DARK BITSPERPIXEL=1[3 ENUMERATED] 1 2 4 Hmm… WideA4 is “off”, “on”, “no”, and “yes”. Well, is there any specific difference between “no” and “off” or “yes” and “on”? Nothing like clarity, is there? One can ask for various sorts of status information as well. @PJL INFO USTATUS DEVICE=OFF [3 ENUMERATED] OFF ON VERBOSE JOB=OFF [2 ENUMERATED] OFF ON PAGE=OFF [2 ENUMERATED] OFF ON TIMED=0 [2 RANGE] 5 300 So I ask for a running status, then mash a few keys to send data that it thinks is supposed to be printed. @PJL USTATUS DEVICE = VERBOSE Hello! Hello! Hello! @PJL USTATUS DEVICE CODE=10003 DISPLAY="Warming Up" ONLINE=TRUE @PJL USTATUS DEVICE CODE=10023 DISPLAY="Printing" ONLINE=TRUE @PJL USTATUS DEVICE CODE=40022 DISPLAY="Pickup JAM" ONLINE=TRUE That’s normal, I’ve not bothered to put any paper into it. ;-) Use the terminal of your choice to connect to port 9100. Then send the command |
Rick Murray (539) 13840 posts |
Crap. Update pushed to my blog, and here’s a direct link for you guys: https://heyrick.eu/blog/index.php?diary=20190729 Sorry. I’m an arse. |
Rick Murray (539) 13840 posts |
M2022W tested at 150dpi (which looks like the same sort of quality as the Android print, jeez). Worked fine, didn’t need any changes, all that setup is in the PCL data. ;-) |
Rick Murray (539) 13840 posts |
Is anybody here familiar with the PDumpers? Just for a test, I created a LaserJet definition set to 1200dpi resolution. It appeared as if it might work, but when the page came out, it was the upper left quarter, thus suggesting to me that maybe it was stuck on understanding scaling or whatnot for 600dpi as the maximum? I’ll be honest with you, I don’t need 1200dpi – 600 is plenty fine (the front page of Frobnicate #31 looks okay, given it’s a black and white printer!) and the file size at 1200dpi was getting a bit… much (13MiB for the page, where 600dpi is ~3½MiB). It’s just… an odd result. I am interested in where/how/why it did what it did. |
nemo (145) 2546 posts |
Steve said
Having implemented PCL5 & 6 in a PostScript RIP I can be definitive about the standard: There isn’t one. We used to joke that the “spec” in “PCL spec” stood for “speculation”. When a Japanese manufacturer specifies PCL compatibility they don’t just specify the manufacturer, they specify the individual model, as behaviour can vary from implementation to implementation. PC drivers then target a specific implementation. I really can’t stress strongly enough what an absolute pain PCL is. PCLXL is somewhat better defined than PCL, but it’s still extremely implementation defined. And by that I mean choose-your-favourite-set-of-bugs-and-go-with-it. The most wonky area is in the support of ROPs (raster ops), which can be highly variable in corner cases. Fortunately, RISC OS doesn’t have ROPs, so any mismatch between expectation and implementation is not going to crop up. Stick to rasterised fonts and the simplest image cases and you’ll be good. Start messing with Intellifont or embedded TrueTypes and it’ll get messy. Steffen exclaimed
Printers often try to guess the format if they support many – it wouldn’t surprise me if that guess was interface-specific.
You don’t have to pay a licence fee to write your own interpreter. Many other implementations are available.
I can assure you that a desktop printer does not have support for a particular PDL by accident. Getting the PDL to work inside the constraints of a desktop printer is by far the hardest part of printer development. It absolutely does not happen by accident. Rick wrote a lot, including
PCL FTW. If your device supports PCL, use that. If they’re pretending that the device doesn’t support PCL it may be because it’s horribly bugged. However, devices for the Japanese market have to have a working PCL implementation. They just do. But I have to stress, PCL does not equal PCL. What works on one device may not on another. It helps enormously if the PCL file is created with banding in mind. If it jumps about all over the page it can cause memory problems in small devices.
I’ve not explored the Dumpers much, but bear in mind that RISC OS plotting is resolutely 16bit (and some things less than that) so that could well cause problems at high resolution. If 600dpi works, I’d be tempted to use that and enhance to 1200dpi – you’re not likely to be able to tell the difference, and I suspect the halftoning would be unusable at 1200dpi. |
nemo (145) 2546 posts |
Apropos of nothing, one of my favourite features of HP’s PCL implementation (which I did not duplicate) is that it draws a single-pixel outline around halftoned text, to sharpen the edge. Clever and effective. However, I did implement an Eagle-style (or SAA-5050 style, if you will) resolution enhancement for bitimaged fonts, which in PCL are often delivered at 300dpi but used at 1200dpi – that smoothed things out very nicely. The most interesting discovery though is that some Japanese drivers don’t bother making any fonts at all – working on the principle that if you have 17,000 glyphs you’re not going to be reusing many of them per page, so why not just draw them. Unfortunately they also did that with Latin text, which absolutely does reuse its glyphs all over the page, which impacted performance noticeably. So I invented a technique where repeated geometry was recognised and turned into a font to take advantage of caching. This is cleverer than it sounds because there seemed to be two stages of quantisation in the glyph geometry, so no two repeated letters were ever numerically identical. Fun. |
Rick Murray (539) 13840 posts |
:-) There’s the “standard” apparently defined by HP, and then there’s everybody’s implementations of it.
I’d be inclined to say PCLm or PCL3GUI, given they’re not openly defined.
The best description that I found for AppSocket said to just imagine that it was a parallel port plugged into the printer. Treat it exactly as that, nothing more, nothing less.
Constraints? It’s a 600MHz ARM with 128MiB onboard. A full resolution page (9924×14028 pixels) is about 17½MiB.
Added as a “feature” with copy-pasted code from an earlier model? Wait, what was that you were saying about bugs? Don’t worry, it’s not a rocket…
No surprise.
That’s useful to know. I’m surprised there’s no “Export model” without, though. Speaking of Japanese – I’ve had a report of it working with a Kyocera M2040dn.
“Enhance it”? |
Rick Murray (539) 13840 posts |
That might make sense with kanji, but surely caching kana would have been useful? “Wa” and “ga” are common particles, and “no” (the pretzel) is a possessive particle that turns up all the time, along with the “ru” verb ending. And that’s just off the top of my head. |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13