Thursday, January 18, 2007

Making a PDF file out of a bunch of JPEGs

1. Convert JPEG files to PS, use jpeg2ps (apt-getable)

1a. If you have a lot of files you can convert them all like this:

find . -iname "*.jpg" -print0 | xargs --replace -0 jpeg2ps {} -o {}.ps

2. Convert all the files of pdfs

find . -iname "*.ps" -print0 | xargs --replace -0 ps2pdf {} {}.pdf

3. Join pdf files with pdfjoin (arg-getable in pdfjam package)

If the files are in the correct order use:

pdfjoin *.pdf

otherwise list the files in order:

pdfjoin file1.pdf file2.pdf...

No comments: