How to batch combine JPEG's from folders into PDF's
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5 Looping
--
Chapters
00:00 How To Batch Combine Jpeg'S From Folders Into Pdf'S
00:25 Answer 1 Score 2
00:49 Accepted Answer Score 16
03:07 Answer 3 Score 5
03:19 Answer 4 Score 22
03:46 Thank you
--
Full question
https://superuser.com/questions/362433/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#macos #pdf #batch #jpeg
#avk47
ANSWER 1
Score 22
On OS X
With Homebrew it's a snap to install ImageMagick:
brew install imagemagick
convert *.jpg output.pdf
and if the resulting PDF is a bit too big you can try:
convert -quality 60 *.jpg output.pdf
Linux, Unix, Windows
Of course ImageMagick can also be installed on other Unix systems, e.g. apt-get install imagemagick
on Debian and Ubuntu. And even on Windows through GNU/Cygwin or Chocolately.
ACCEPTED ANSWER
Score 16
OS X has several tools built in to automate image processing and PDF creation.
Just open up Automator.app, create a new Application.
Change it as shown below, by dragging the actions from the left pane to the right one.
Get Folder Contents with the Repeat… option enabled will get all your files, even from within the subdirectories.
New PDF from Images will create one PDF file on the desktop, each page consisting of one image.
Save the app somewhere (e.g. under /Applications or on your Desktop). Give it a proper name, like "Create PDF from Image.app". Then, you can drag your folders on its icon. Let the workflow do the job for you.
The above creates one single PDF file for all images. If you want to have one for each folder, that's going to be more complicated.
First, you need the Dispense Items Incrementally action. Install it. Then, open Automator again, and create a new Workflow (not an application).
Now, for convenience, you can download the workflow here. In case that link breaks, just change it as shown below:
Or, in text form:
- Get Selected Finder Items
- Dispense Items Incrementally (the one we installed before)
- Set Value of Variable, to remember the folder we're in
- Get Folder Contents, to get the images
- New PDF from images, to create the PDF. Here, take the variable from the "Variables" panel at the bottom and drag it to the "Save Output to…" field. This makes sure the PDF is created in the folder it belongs to. There's no easy way to rename the file other than setting a static file name. You could add a Rename Finder items action to set it though.
- Loop, to begin from start and run with the next folder. You can disable the part where it asks for confirmation.
Save it as a Workflow, and now, here's how to execute it. Select your folders in Finder.
Then, go to Automator.app and click Run in the top right corner.
With 500 folders, that might take a while. Especially with high resolution pictures, your PDF might become huge. But you can try it on a smaller selection first and then let the workflow run until it's finished.
ANSWER 3
Score 5
A more simple way is to view all the images in Preview, then print to PDF, very quick.
http://hints.macworld.com/article.php?story=20090119162659107
ANSWER 4
Score 2
On almost any system you'd be running this on your best solution may be ImageMagick. Available on *nix, Mac and Windows, supports both wildcarding (aka filename globbing) and specification of a list (e.g. @ImagesToProcess.txt) of input files, some advanced file specification options, a powerful command line, etc.