|
Re: new fax print button only works from main inbox
|
Alexander Caldwell
|
Oct 19, 2007 17:30 PDT
|
Jerry,
I did some more fiddling today and found that
if you get the error message about not converting
line XXX, eol etc.- if you had more than one fax
selected for printing, it would only print the first
selected one, and then the foreach Tcl loop would
exit, so the next selected fax file
in line would not print. So I tried suppressing the
error message by sending it to /dev/null in
testprint.sh like this:
g32pbm $1 $2 | pbmtolps -dpi 208 | lpr 2> /dev/null
But that did not work. However, you will also notice
now there are two "argument" variables $1 and $2 now
to the shell script that get passed in when it starts
up - the $1 is now for the -f or -n value for g32pbm
and the $2 is now for the filename - more about that
later.
So what I found does work is to put a Tcl catch
statement in the foreach loop around the exec
testprint.sh
statement, then you still see the error message in
a Tk dialog, but it does not cause the loop to exit,
and you can print multiple selected faxes.
I will try to check into why it does not print from
the other inboxes - I think it is because
/var/spool/fax/incoming/$i hardcodes the path. I will
have to change the /var/spool/fax/incoming to a
variable for the different directories. That should
not be too hard.
Here is the latest print button code (turn word wrap
off to see in proper Tcl syntax. You can see how it
uses regexp to detect whether there is an fn or ff on
the beginning of the fax filename:
button .faxes.print -text "Print Sel. Faxes" -pady
0 -command {
foreach i [selection get] {
if {[regexp {^fn} $i]} {
set this_resolution {-n}
} else {
set this_resolution {-f}
}
if [catch {exec
$rootdirectory/drug_programs/testprint.sh
$this_resolution /var/spool/fax/incoming/$i} err] {
tk_dialog .bad_fax_message Error "There
may be a relatively minor conversion error in g32pbm
or pbmtolps... $err" error 0 OK
}
}
}
pack .faxes.print -expand true -fill x
Alex
--- Jerry Park <park.-@gmail.com> wrote:
| | Alex,
I'm off today, so working on the home office
computer with
Tkfp59-Grafpup2.00. I had to find the missing
dependency
libnetpbm.so10, which I found in an old rpm (newer
one wouldn't work).
I copied your new "Print Sel. Faxes" button to the
new
Tkfp59-Grafpup2.00 installation of note_gen.tcl per
your instructions.
So I entitled my shell script "faxprint.sh" instead
of "testprint.sh"
and it works OK, but it only works on faxes in the
main inbox.
Otherwise, I get an error that the script can't find
the fax file
requested. I run Tkfp from /root/Tkfp just like you
do. I'm still
getting those column eol errors, but the fax prints
fine. I'm also
getting error messages from CUPS at the bottom of
the page, which are
more just annoying:
installpagedevice
Operand stack:
--nostringval---
--dict:54/56(ro) (L)--
etc, etc.
I remember we discussed those types of error
messages before and
they're probably from ghostscript.
I see that setting up the VIEWFAX_PRINT environment
variable is
unnecessary, because your new print button is usable
from the
"Incoming Faxes" window while one is viewing the
faxes with viewfax
(i.e., the two are running "side-by-side"). As a
matter of fact, your
new button is better, because it allows the user to
choose any or all
of the faxes to print in the incoming fax window
while viewing any
number of faxes with viewfax.
The new function printed very fast on my home office
system, so as I
expected it's more just system speed and memory
dependent.
Jerry
|
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|
|
 |
|