<<< Date Index >>>     <<< Thread Index >>>

Re: tiff to pdf



* bill lam on Sunday, November 09, 2008 at 16:13:54 +0800
> When I receive email with tiff attachment, my default image viewer
> 'feh' can not handle it and I'm reluctant to install another image
> viewer. Although I can save it and convert to pdf with command
> $tiff2ps -a foo.tif | ps2pdf - > foo.pdf
> 
> How to automate this process within mutt so that it can convert any
> incoming tiff into pdf automatically. Then the pdf can be viewed using
> xpdf.

There's also tiff2pdf which would safe the detour via ps2pdf.

Unfortunately piping to 'xpdf /dev/stdin' doesn't work in this
case.

But the following script does for me:

$ cat muttiff.sh
#!/bin/sh

tf=`mktemp`
# copy mutt's tempfile so it's not removed to early
cp "$1" "$tf"
tiff2ps -a "$tf" | ps2pdf - > "$tf.pdf"
xpdf "$tf.pdf" && rm -f "$tf" "$tf.pdf"


in connection with the mailcap entry:

image/tiff; muttiff.sh %s


HTH

c
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
Ein deutscher Western/A German Western
-->> http://www.blacktrash.org/underdogma/ccc.html
-->> http://www.blacktrash.org/underdogma/ccc-en.html