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
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 command, installed on your computer.
Also, the latest version is written using
Automator, so it will only work in
OS X 10.6 (Snow Leopard) or later.
unzipthe file (by double-clicking on
Applicationsfolder (or anywhere you prefer).
Terminal, create a preferences file named
.fontbegoneto set the correct
Pathfor the ghostscript executable. This can be done automatically using the one-line command
echo "gsBin = '"`which gs`"'" > ~/.fontbegone.
FontBegoneapplication 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
FontBegonewill 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!
FontBeGonedoesn't just convert entire files, but also PDF images copied from arbitrary sources. For example, use the
Select Toolof your favorite
copyit to the
Pasteboard. Before attempting to paste into Illustrator, just
tap the iconof
FontBegoneto 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
Pasteboardand 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
FontBegonewhich don't allow conversion on the
gs. These must be installed, otherwise FontBegone will exit without doing anything.
PATHvariable must be set correctly.
gsfrom the command line. The output of
gs --versionshould be larger than
.fontbegonemay be incorrect.
import os,sys,tempfile,shutil from AppKit import * from Foundation import * def doconversion(): r1=os.spawnlp(os.P_WAIT,gsBin,gsBin,"-sDEVICE=pdfwrite", "-dNoOutputFonts", "-sOutputFile="+outnamepdf, "-q", "-dbatch", "-dNOPAUSE", "-dQUIET", inname, "-c", "quit") return r1 def getVarFromFile(filename): import imp f = open(filename) global data data = imp.load_source('data', '', f) f.close() rr=64 preferences=os.path.join(os.environ["HOME"],".fontbegone") if os.path.isfile(preferences): initialization = open(preferences,"r") gsPath = initialization.read() initialization.close() gsBin = gsPath getVarFromFile(preferences) gsBin = data.gsBin else: gsBin = "/usr/texbin/gs" tmpdir = tempfile.mkdtemp("","fontBegone","/tmp") inname=os.path.join(tmpdir,"infile") outnamepdf=os.path.join(tmpdir,"outfile.pdf") if len(sys.argv) > 1: for arg in sys.argv[1:]: imgFileName = os.path.abspath(arg) if os.path.isfile(imgFileName): [imgDir,imgName] = os.path.split(imgFileName) outFileName = os.path.join(imgDir,os.path.splitext(imgName)+"-nofont.pdf") sys.stderr.write("converting "+outFileName) shutil.copyfile(imgFileName,inname) rr = doconversion() if rr==0: shutil.copyfile(outnamepdf,outFileName) else: sys.stderr.write("Conversion of file failed") else: sys.stderr.write("non-existent input file") else: board=NSPasteboard.generalPasteboard() result = board.dataForType_(NSPDFPboardType) if result: result.writeToFile_atomically_(inname,1) rr = doconversion() if rr==0: content=NSData.dataWithContentsOfFile_(outnamepdf) board.declareTypes_owner_([NSPDFPboardType], None) board.setData_forType_(content, NSPDFPboardType) else: sys.stderr.write( "Nothing to convert.") try: os.remove(outnamepdf) except: sys.stderr.write("Error removing one oer more temporary output files") try: os.remove(inname) except: sys.stderr.write("Couldn't remove temporary input file") os.rmdir(tmpdir) sys.exit(rr)