3

How can I convert JPG into PDF easily? shows have to use homebrew to convert .jpg files into .pdf. I would like to convert many TIFF files to PDF but can not get it to work.

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 ?

  • Have you tried the command convert *.tiff output.pdf? What message or output is returned? – Graham Miln Jun 21 '17 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. – Laurent Richer Jun 21 '17 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 – Laurent Richer Jun 21 '17 at 18:17
3

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 \;
  • Ho MY GOD... this is exactly what i have been looking for!!!!!! – Laurent Richer Jun 21 '17 at 22:02
  • do you think there is a similar language that can be used for DOS? – Laurent Richer Jun 21 '17 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. – Laurent Richer Jun 21 '17 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 '17 at 22:03
  • whether it is possible or not THANKS EVER SO MUCH (yes i'm shouting the joy :) ) – Laurent Richer Jun 21 '17 at 22:04

You must log in to answer this question.

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