To convert a single file you can use
/System/Library/Printers/Libraries/convert -f path/to/source.file -o destination.pdf
If you want to convert in bulk you can use AppleScript.
Open Script Editor from /Applications/AppleScript, then in a new script copy and paste
on open input_documents
repeat with this_document in input_documents
set this_document_path to POSIX path of this_document
--display dialog this_document_path
do shell script "/System/Library/Printers/Libraries/convert -f " & quoted form of this_document_path & " -o " & quoted form of this_document_path & ".pdf"
end repeat
end open
then from File Menu select Save As. In File Format select Application. Give it a name, and then you can drag and drop your files onto it, and hey presto converted to PDF.
get an error message concerning the MIME type of the file I tried to convert to pdf using your script...
ReplyDeleteWhat kind of file did you try?
ReplyDeleteA FreeHand one. Actually, the only kind of file sthat gives me trouble getting a pdf from, in Snow Leopard.
ReplyDeleteSo this is most likely a problem with your file, not with my script?
ReplyDeleteIs the file damaged? Can you copy elements to a new file?
I get the same error message for every FH file I tried to print to pdf using your script.
ReplyDeleteUnfortunately, FH's files are the only one giving me problems when trying to get a pdf from the print panel (I first have to generate a .ps then get it converted to pdf with Distiller). It's a long way to get a "stupid" pdf. Thought your script would have eased my pain.
But it didn't...
My guess would be that OSX has no built-in converters / viewers for Freehand files. I only have Freehand MX (ie v11) and get the same error on both v11 and v10 files.
ReplyDeleteIf I export from FH as png that converts no problem using the script, so my guess is that the CUPS converter doesn't like Freehand files.
Maybe you could make an AppleScript that open each file and exports to PDF?
I tried this with a .doc file but I got the error convert: "Unable to determine MIME type of "document.doc"!
ReplyDeleteDoes that mean OS X doesn't have built in convertors for .doc files?
That would be my guess. If you are using 10.5 / Leopard or 10.6 / Snow Leopard, and you select the file and press the space bar for the Quick Look (if I hav that correct) what do you see?
ReplyDelete