Re: [SLE] How to compile a series of jpg files to a pdf booklet?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2006-06-16 a las 11:11 +0800, CS - Ronald Wiplinger escribió: You forgot to email to the list.
However, the quality and size obtained by using the jpg files directly is better than with pdf. An alternative I prefer is to use the DjVu format: perfectly suited to scanned material (high compression of scanned text without artifacts, for instance), and better quality and size ratio than jpg, with multipages files as well. Unfortunately, converting to djvu is not simple (as in click-click), but if you are interested, I'll post my method.
I and I am sure many others are very interested in knowing how to do that.
You need to install "djvulibre....rpm", I think version 3.5 comes with SuSE 10.1. I have that same version, but compiled by myseld, so paths are diferent for me. You also need pngtopnm for conversion from .png files (package netpbm). I made this script, which is far from perfect. It takes a .png file (or a .jpg) from input and converts it to .djvu. The trick is that the conversion program, c44, can not handle .png files, unfortunately: I have to convert to pnm format first. In fact, I see now some errors in my script: options -vhi and -ehi for jpg files will fail (easy to solve, any way). I modify the script when I need it, you see... It also will fail if the filename contains an space: I don't know how to handle that at the moment. The "slices" I use I arrived at by trial and error. I don't know a better method. There are payware tools for djvu that are supossedly much better. And creation is slow, although viewing is fast. ---- /usr/local/bin/png2djvu --- #!/bin/sh C44=/usr/local/bin/c44 <-- change that. PNGTOPNM=pngtopnm case "$1" in -low) SLICE=" 19+17+13+9+7+5+3+2+1" ;; -med) SLICE="23+19+17+13+9+7+5+3" ;; -hi) SLICE="23+19+17+13+9+7+5+3+2+1" ;; -vhi) ;; -ehi) ;; *) echo "Convert graphic.png file to graphic.djvu file" echo "Sintaxis:" echo " png2djvu [-low|-med|-hi|-vhi] inputfile (png or jpg assumed)" echo "To convert to a multidocument single djvu file, use:" echo "djvm -c Destino.djvu page_1 page_2 page_3 ..." exit ;; esac for FILE in `ls $2` ; do echo Converting $FILE # file exists and greater than zero. if test -s "$FILE" ; then DIRECTORIO=`dirname "$FILE"` TIPO=`/usr/bin/file -ib "$FILE"` case "$TIPO" in "image/jpeg") $C44 -dpi 240 -slice $SLICE -crcbhalf "$FILE" ;; "image/png") NOMBRE=`basename "$FILE" png` NOMBRECMPLTO=$DIRECTORIO/$NOMBRE $PNGTOPNM "$FILE" > "$NOMBRECMPLTO"pnm #ls -lh "$NOMBRECMPLTO"pnm #$C44 -dpi 240 -slice $SLICE -crcbhalf "$NOMBRECMPLTO"pnm case "$1" in # no le gustan los espacioes dentro de las comillas "" -low) $C44 -dpi 240 -slice "19+17+13+9+7+5+3+2+1" -crcbhalf "$NOMBRECMPLTO"pnm ;; -med) $C44 -dpi 300 -slice "23+19+17+13+9+7+5+3" -crcbhalf "$NOMBRECMPLTO"pnm ;; -hi) $C44 -dpi 360 -slice "23+19+17+13+9+7+5+3+2+1" "$NOMBRECMPLTO"pnm ;; #-vhi) $C44 -dpi 360 -slice "27+23+19+17+13+9+7+5+3" "$NOMBRECMPLTO"pnm ;; -vhi) $C44 -dpi 360 -slice "72+11+10+10" "$NOMBRECMPLTO"pnm ;; -ehi) $C44 -dpi 720 -slice "72+11+10+10" "$NOMBRECMPLTO"pnm ;; #72+11+10+10 esac rm "$NOMBRECMPLTO"pnm ;; *) echo "Non recognized file type ($TIPO) for this script." exit ;; esac else echo "$FILE" not found or zero size. fi done - ---------------
BTW, I use SuSE 10.1, how can I install pdftk?
Well, pdftk-1.12-18.i586.rpm is included in the distro, but I don't know if it comes in the CDs or only by ftp. - -- Saludos Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFEkoN0tTMYHG2NR9URAjutAJ0dZPGHxw/ABmVU3qN62kdvsiquNgCeINrt IISgpbFkrdb8Kboj+YPpTX0= =ATY5 -----END PGP SIGNATURE----- -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (1)
-
Carlos E. R.