====== Converting jpeg to pdf with imagemagick and pdfjoin======
{{tag>pdf jpg convert pdfjoin imagemagick}}
Necessary files:
apt-get install pdfjam
apt-get install imagemagick
Script:
Quelle((http://ultrahigh.org/2008/10/14/command-line-face-detection/))
#!/bin/bash
tempfiles=""
OUTPUT="jpg2pdf.pdf"
function die() {
echo $*
exit 1
}
for file in $*; do
ext=${file##*.}
base=`basename "$file" .$ext`
pdf="/tmp/$base.pdf"
echo "$file => $pdf"
convert -rotate 90 "$file" "$pdf"
[ -e $pdf ] || die "Conversion to pdf failed"
tempfiles="$tempfiles $pdf"
done;
pdfjoin $tempfiles --outfile jpg2pdf.pdf
[ -e $OUTPUT ] || die "Join of PDFs failed"
rm $tempfiles
{{tag>"JPG to PDF" "JPEG to PDF" "Image to PDF" "JPG2PDF" "Bild in PDF"}}