Sunday, June 15, 2008

It's the year 2008...

Forget my flying cars. Why the heck can I still not print from Linux (more specifically, Ubuntu 8.04)?

I threw together a little applet to stitch together a Puget Sound navigation chart from NOAA (check out chart number 18449). This isn't acceptable for navigation, they say, but hey: I just want something to look at. I don't own a yacht, boat, or even a kayak; the extent of my water vessel ownership is owning a swimsuit and goggles...

It was a success; you can download it here, if you're so inclined. Anyway, now to print it.

Oh, god, the agony.

I tried Eye of Gnome first. I tweaked my printer settings a bit (I'm printing this to 13"x19" glossy paper instead of the normal letter paper) and hit print. The system starts puzzling over this for a bit (at least if the CPU usage bar is any indication) and then... nothing.

I open up the printer jobs viewer. It says the job is stopped with no indication at to why. That's strange. I cancel it and try again. Same result.

Ok, maybe EOG is flaky. I cancel the second job and start up Gimp (which, incidentally, is an exceedingly dumb and potentially offensive name for an image editing program, but I digress...). I change the settings again, hit print... and, again, minutes of thinking followed by nothing. I do the cancel/reprint/cancel/print a test page/reprint shuffle a few times, but all to no avail.

Hrm. Something is amiss. I check out the CUPS logs:
E [15/Jun/2008:23:11:10 -0700] PID 28099 (/usr/lib/cups/filter/pstoraster) stopped with status 1!
E [15/Jun/2008:23:11:11 -0700] [Job 226] Job stopped due to filter errors.

Well, that's interesting. But why is this pstoraster program failing? Any logs?

Nope, can't find them. But it turns out that pstoraster is a shell script which does attempt to print some logs out -- they're probably just going to /dev/null. I write a wrapper to send its output to /var/log/cups/pstoraster.log, try printing again, and see what I get.

Oh, joy. It's failing somewhere deep in the bowels of Gutenprint and Ghostscript:

DEBUG: Running /usr/bin/gs -dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOMEDIAATTRS -sDEVICE=cups -sstdout=%stderr -sOUTPUTFILE=%stdout -c -
... many lines of garbage deleted ...
Error: /rangecheck in --image--
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop
1904 1 3 %oparray_pop 1888 1 3 %oparray_pop 1771 1
3 %oparray_pop --nostringval-- %errorexec_pop .runexec2
--nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
--nostringval-- 1809 1 3 %oparray_pop
Dictionary stack:
--dict:1149/1684(ro)(G)-- --dict:0/20(G)-- --dict:126/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
DEBUG2: cups_close(0x685378)

Catch all that? This will be on tomorrow's quiz.

How did I end up printing this? I fired up Windows XP in VMware Player, opened the image using an old copy of Paint Shop Pro 5 (which works well for 99% of my image editing needs), and hit print. Pretty map came out a few minutes later.

Seriously, folks: this is an embarrassment. You're making Vista look like a dream.

No comments: