[26475] in Athena Bugs
Re: acrobat 7 printing
daemon@ATHENA.MIT.EDU (Alex T Prengel)
Thu Jul 7 19:41:26 2005
Message-Id: <200507072340.j67NeK4o012086@dit.mit.edu>
To: jhawk@mit.edu
In-reply-to: "[26474] in Athena Bugs"
Date: Thu, 07 Jul 2005 19:40:20 -0400
From: Alex T Prengel <alexp@mit.edu>
X-Spam-Score: 1.041
X-Spam-Level: * (1.041)
X-Spam-Flag: NO
cc: alexp@mit.edu
cc: bugs@mit.edu
Errors-To: bugs-bounces@mit.edu
Hi, you wrote to bugs:
>acrobat 7 printing defaults to /usr/bin/lp.
>
>This is very confusing for any users who want to add -Pprintername or
>-Zduplex.
>(I've had several queries to date).
>
>Can the wrapper script be adjusted to fix this?
Short answer: tell users to set the print command to
/usr/athena/bin/lpr in the print dialog the first time they print, it
should stick thereafter.
Long answer:
I did some research and dealing with it is painful:
1. the main acroread 7 binary has a hardwired default print command
which is apparently /usr/bin/lp for Linux and /usr/bin/lp -c for Sun
(I just installed the latter today- it will become the Solaris default
overnight)- I found this by running "strings" on the binaries. For
Linux, the string "*lprCommand: /usr/bin/lpr" also shows up but I can't
figure out any way to use this.
2. each user gets a local configuration file
~/.adobe/Acrobat/7.0/Preferences/reader_prefs which is created the first
time they run acroread 7. It has various default settings that are editable
(for the most part) from within acroread. An entry is made in this file that
contains the name of the print command, but only after the user has printed
at least once. It's some complicated tagged-text structure; the relevant
printer command line looks like this:
/printerCommand [/s (/usr/bin/lp -c)]
at a specific tag level within the entire file. This takes precedence on
subsequent acroread launches, and each time she prints, the user has the
option of setting the desired print command which is written back to the file.
The only way to change the default printer command after the user has
printed something is to edit this file, as far as I can tell. By far
the easiest way is just to tell the user to edit it in the print
dialog (to /usr/athena/bin/lpr), which should stick. It could be
edited "invisibly" by running a sed command that, if the file exists
and has a /printerCommand line, edits the part in parens to
/usr/athena/bin/lpr. I'm reluctant to do this for several reasons- I
don't like editing user's files behind their backs (they might have
intentionally changed the print command for some reason); the script
could ask for permission first but that could confuse them and the
whole thing gets really too complex.
Even for new users, the only practical way I can see of getting around this is
the trick I've been using for Star Office- run it once (as myself), set
desired settings, tar up the entire local config tree and put it in the locker;
the launch script then checks if a user already has a local configuration tree
and if not, tars down the saved "template copy" for them. I don't want to
do that in this case because it would bypass the license that users need to
accept before running the software the first time.
I really think telling users to set it manually is the best solution.
Alex