Function: Converts any images selected in the foremost Finder window into PDFs (requires ImageMagick).
Author: James Fisher, Denison University
Notes: This workflow builds around the ImageMagick convert utility, it can be installed via Fink. Otherwise, the heavy lifting of the workflow is performed by an AppleScript, so be prepared for a wait depending on the number of images selected. Please be aware that the processing path cannot contain spaces, so a new folder called “ImagestoPDFs” is created on the desktop for the final documents to reside in. Comments, constructive only, are always welcome. Enjoy.
(Note that a number of actions in this workflow have broken folder paths that require correcting- Steve)
Just realized that Apple provides an example of using CoreGraphics to convert an image to a pdf in /Developer/Examples/Quartz/Python/image.py. This would probably be the place to start writing an Automator action that did so.
Comment by algal — August 21, 2006 @ 4:18 am
Hi,
Preview.app already has the capacity to convert images into pdfs by doing a “print to pdf” of the image. Would it be possible to remove the dependency on fink’s imagemagick by writing an app that just used Preview?
Comment by algal — August 21, 2006 @ 4:01 am
Matt, I like the look of this workflow. It looks like Fink doesn’t want to install on my OSX Tiger. In which case, how would I change the Run Applescript action to the Desktop, or somewhere. Thanks, AAron
Comment by AAron — January 6, 2006 @ 2:16 pm
hello, thanks for the workflow. i started changing the applescript as it would not handle filenames with spaces, and eventually just created a script to do the whole job. here it is.
tell application “Finder” to set the selected_pics to selection
repeat with i from 1 to the count of selectedpics set picitem to (item i of selectedpics) as alias set inpic to POSIX path of picitem set outpic to (removeExtension(inpic)) & “.pdf” do shell script “/sw/bin/convert” & ” ” & quoted form of inpic & ” ” & quoted form of outpic end repeat return selectedpics end run
– remove extension
on removeExtension(inpic) set outpic to {} set AppleScript’s text item delimiters to “.” return first text item of in_pic end removeExtension
Comment by tanner — December 2, 2005 @ 3:26 am
Maarten: you need to have ImageMagick installed via Fink. If you install ImageMagick some other way, you need to change the path in the Run Applescript action.
Comment by Matt Moriarity — June 5, 2005 @ 1:44 pm