Here is a small Mac OS X Application built with Apple's Automator and Python. I use it to incorporate all or part of a PDF file into Adobe Illustrator.
It's function is to replace all fonts in the PDF file with outlined paths, to prevent Illustrator from issuing warnings about missing fonts and garbling the original text in the process. If the image on the right looks familiar to you, then this page may be what you need.
The original version of this Application dates back to a discussion on the OS X TeX mailing list in 2005. There is some more discussion of these font-related issues on the Illustrator page linked here.
FontBegone is a utility that can be run either by dragging files onto its icon, or by simply tapping its icon while a PDF is on the Pasteboard of your computer.
Whatever document you feed into FontBegone will then be processed by invoking ghostscript. All text will be replaced by outlined paths (i.e., graphics objects) so that the shapes of the original characters stay exactly the same, instead of being replaced by substitute fonts.
The advantage of this is that you can then edit the outlined paths using all of Illustrator's drawing tools. The downside is that Illustrator's Text tools don't apply to the outlined paths: you no longer have text, but graphics to edit.
You need to have ghostscript, in particular the gs and ps2pdf commands, installed on your computer. These commands will automatically be installed if you have the MacTeX distribution. Alternatively, you can also install ghostscript from Fink or MacPorts (ps2pdf is part of that package).
Also, the latest version is written using Automator, so it will only work in OS X 10.6 (Snow Leopard) or later.
zipped Application
FontBegone.zip.
unzip the file (by double-clicking on FontBegone.zip).
FontBegone to your Applications folder (or anywhere you prefer).
FontBegone application to the toolbar of my Finder windows, see this screenshot (FontBegone is not the only home-made utility I've placed there, as you can tell by the weird-looking icons):
There are two ways of using FontBegone:
PDF files, and drag them onto the FontBegone icon
. FontBegone will have created a new file for each input file, differing in filename by the addition of "-nofont.pdf". So an input file "paper.pdf" will be converted to "paper-nofont.pdf" in the same directory. These output files will usually be larger than the input files. That shouldn't be too surprising, given the fact that each character of text is now drawn as a little picture!
FontBeGone doesn't just convert entire files, but also PDF images copied from arbitrary sources. For example, use the Select Tool of your favorite PDF reader application to pick a rectangle in a PDF document, and copy it to the Pasteboard. Before attempting to paste into Illustrator, just tap the icon of FontBegone to activate the application (a single click is enough if you have the icon in the Finder toolbar or on the Dock). Again you will see a spinning gear in the menu bar until the conversion has finished. Now the converted PDF will be on the Pasteboard and you can insert it into Illustrator without the dreaded font warnings. With this approach, you only need a single click between copying and pasting a PDF from any source to Illustrator.
FontBegone which don't allow conversion on the Pasteboard:
gs and ps2pdf. These must be installed, otherwise FontBegone will exit without doing anything.
PATH variable must be set correctly.
gs and ps2pdf from the command line. If you can't, then your PATH variable isn't set up correctly, and you have to consult the instructions for your specific TeX installation on how to fix this.
defaults write ~/.MacOSX/environment PATH $PATH
environment.plist inside the folder .MacOSX. The purpose is to take the PATH variable created by your own shell initialization and deposit it in the .plist file.
In my case it contains the following (this depends on your shell variable $PATH):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PATH</key> <string>/sw/bin:/sw/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin</string> </dict> </plist>
<string> tags, the directories to be searched for shell executables are listed, separated by colons. You may have to customize this list to make sure it includes the path to your gs and ps2pdf executables.
environment.plist: this file is intended to keep all OSX applications on the same page with respect to the underlying UNIX shell environment, thus maintaining a coherent integration of low-and high level functions in OSX. The defaults command overwrites any setting for PATH that may have existed previously in that plist file. This should not be a problem if you have a properly initialized command line shell, because that initialization in turn would have included reading environment.plist, and then prepending or appending some entries to the PATH variables. So you should not end up losing anything that was there before in your environment.plist. However, if you aren't sure that your initialization is sane, just make a backup copy of environment.plist before executing the defaults command. The worst thing that can happen with the above defaults command is that some directories will occur in duplicate in your PATH, but that's completely harmless.
#!/bin/sh gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=- -q -dbatch -dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "`echo $1 | cut -f1 -d'.'`"-nofont.pdf
There is a reason why I don't have ghostscript write PDF output directly: the NOCACHE doesn't work directly with the PDF device.