Transformando arquivos dhw em djvu

Fiz para me ajudar com o Digimemo A502, da acecad. Deve suportar o A501 também, já o restante dos modelos eu não tenho certeza.

################################################################################
# Converts dhw files into djvu ones
# Requirements:
#   netpbm: http://netpbm.sourceforge.net/
#   dhw2ps.pl: http://www.etes.de/opensource/digimemo_a501_converter_linux/
#   djvulibre: http://sourceforge.net/projects/djvu/
# From http://cemshost.com.br/wikis/Linux/dhw
################################################################################

# Begin Configuration
# change it if dhw2ps.pl is not in your PATH
dhw2ps=dhw2ps.pl
# End Configuration

if [ -z $1 ]; then
  echo "Which dir (no ending slash) has the dhw files?"
  exit
fi

dir=$1

pushd .
cd $dir

for file in *; do
  echo $file
  $dhw2ps $file
  bname=`basename $file dhw`
  ps=${bname}ps
  pgm=${bname}pgm
  djvu=${bname}djvu
  pstopnm -stdout -dpi=300 -pgm $ps | pnmcrop -white > $pgm
  cjb2 -lossy $pgm $djvu
done

rm -f *pgm *ps
popd

djvu=`basename $dir`.djvu
djvm -c $djvu $dir/*.djvu
rm -f $dir/*.djvu

# Creating indirect document (optimized for the web).
# It'll be available by $dir/index.djvu
# Comment these out if you won't display it online and use the DIRNAME.djvu
# created in the current path.
djvmcvt -i $djvu $dir index.djvu
rm -f $djvu

# If everything went well, dhw files won't be necessary anymore.

WikiLinux: dhw (last edited 2008-07-24 02:20:21 by CaduSantos)