Re: [Gimp-user] Free software for Batch file conversion





On 05/27/2018 02:24 PM, Steve Kinney wrote:

[...]

Or if you are using an operating system that supports it, and your
images are whole pages, imagemagick might do the trick way more simply
and quickly.  On Linux I have used it to convert scanned pages to PDF.
The images will appear as pages in alphabetical order, so add 01, 02,
etc to the front of their names if needed.  Then...

1.  Examine the images, determine a good target width for all of them.

2.  Edit images if/as required.

3.  If necessary equalize image widths via:  mogrify -resize [pixels] *.jpg

*NOTE* Assure that all images have the same DPI value, use "mogrify
-density [DPI] *.jpg" (or png, etc.) if required.

4.  To convert all images in a directory to one pdf file, do:

convert *.jpg [output].pdf

With a large number of pages, the process tends to hang.  In that case,
this script has done the trick for me.  Copy and save the text below as
a plain text file, put it in your home directory's /bin folder and set
it as executable (chmod +x [script-name.scr]).  Then put the images in
one directory (anywhere), open a terminal there and type the name of
your script to run it against your images:

#!/bin/sh
# convert large number of .jpg files to one PDF file.  Equalize widths
of .jpg files first via: mogrify -resize [pixels] *.jpg

for f in *.jpg;
do
convert "$f" "${f%.jpg}.pdf"
done
pdftk *.pdf cat output combined.pdf/

I forgot:  Requires imagemagic (of course) and, if using the script,
also pdftk ("PDF Toolkit).  You might need to install them, but if so
the are in the repos so that should present no problem - use your
package manager, or appropriate terminal commands.  For instance, on
Debian family systems (Ubuntu, Mind) do:

sudo apt-get install imagemagick pdftk

:o)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]