3

How can I convert JPG into PDF easily? shows how to use homebrew to install imagemagick and then convert .jpg files into .pdf. I would like to convert many TIFF files to PDF, keeping the same name and changing only the extension.

For JPEG files, the advice was to use the following command:

  1. brew install imagemagick
  2. convert *.jpg output.pdf

I am trying to use the Step 2 command for *.TIFF files into *.PDF.

However, despite using the command line to the letter, I am unable to change my 300 files with this single line. In fact, no file is converted at all.

Would anyone be so kind to provide a helping hand ?

3
  • Have you tried the command convert *.tiff output.pdf? What message or output is returned? Jun 21, 2017 at 17:59
  • I forgot to mention that i was looking to have each individual .jpg file to be converted into a .pdf file of the same name. Jun 21, 2017 at 18:16
  • i tried this command but files are compl=iled into a single file. i'm looking to have individual files with the same name as the original file Jun 21, 2017 at 18:17

1 Answer 1

4

The * in convert *.jpg output.pdf expands to the list of inputs. This means the command you were actually running looked like:

convert one.jpg two.jpg three.jpg output.pdf

As you can see from this, that's not what you want, since all the images will be compiled into the output PDF. Also, as the command contains ‘jpg’, it looks for ‘jpg’ files, not ‘tiff’, so you need to change this too.

Therefore, you need to run that command for each of the inputs.

find /path/to/folder -iname "*.tiff" -exec convert {} {}.pdf \;
5
  • Ho MY GOD... this is exactly what i have been looking for!!!!!! Jun 21, 2017 at 22:02
  • do you think there is a similar language that can be used for DOS? Jun 21, 2017 at 22:02
  • I ask this because now that i understand what to do on my mac at home, i need to replicate this on my office machine, which is running on a microsoft windows platform. Jun 21, 2017 at 22:03
  • Excellent, welcome to Ask Different! If an answer solved your problem, you can mark the answer as accepted using the check mark on the left under the voting buttons. Unfortunately I have no experience with scripting for DOS, I couldn't help you there
    – grg
    Jun 21, 2017 at 22:03
  • whether it is possible or not THANKS EVER SO MUCH (yes i'm shouting the joy :) ) Jun 21, 2017 at 22:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .