Thursday, August 14, 2008

Evince Bug Workaround

Evince has been a continuous battle for me ever since I switched from KDE to Gnome. Ok, more of an occasional annoyance than a continuous battle, and the various problems I've had with Evince convinced me to install and primarily use kpdf for awhile. Well, I've got a fresh Ubuntu install, and didn't want to litter it with all the junk that comes along with kpdf, so I've been using evince. However, evince wants to print everything in A4 format. Yes, my printer defaults are letter. Yes, the PDF documents are letter size. Yes, /etc/papersize contains one line, letter.

I remember wasting an afternoon on this sometime back, so the question became tell evince to use letter every single time I print, go back to kpdf, or waste another afternoon with no guarantee of better results than last time.

First tried the obvious thing:
man evince

Totally useless. Instead of placing everything in one place, the evince folks have decided to scatter documentation all over the place at their web site. But, unlike last time, Google found me a solution, a recent blog entry by Dominique Cimafranca at UbuntuLiving. He apparently uses bash, and so suggests a change to the user's .profile. I use tcsh, and so added this line to my .cshrc:
setenv LC_PAPER en_US.UTF-8@letter

UbuntuLiving suggests that after making this change, one log out and then back in. Not necessary. Any new xterm opened from that point will have the correct setting, or one can just type
source ~/.cshrc

in an existing xterm (or gnome-terminal, or konsole, or whatever) and LC_PAPER is set. Then the next time you type the evince command, it'll actually print correctly with no gyrations by the user. Imagine that.

Is this a bug within evince? The evince folks may think not, but Google is unable to find any mention of LC_PAPER at and the man page is useless, so the documentation is woefully lacking. Yeah, I'm using an undocumented feature. It'll probably break with the next release.

No comments: