Embedding fonts in PDF-files

A while back I wrote a course-reader in OpenOffice.org Writer on Ubuntu. When I submitted it for printing, it turned out that not all fonts were embedded in the document, which led to various printing- and layout-problems. Here's some advice on how to create PDFs that are suitable for printing by third parties.

OpenOffice.org

Make sure you use OpenOffice.org 3.x, export as PDF and try selecting select the option "PDF A/1". This should produce a PDF/A compliant file which is suitable for archiving, and therefore has to have all fonts embedded. Also, for best printing-results the compression of images should be set to lossless.
In the past there were several problems with this method. First, PDF/A apparently does not support transparant objects. Unfortunately, instead of simply blending my embedded PNG-files with the background, older versions of OpenOffice.org PDF/A export seemed to erraticly convert transparant areas to black. Moreover, in some versions of OpenOffice.org Writer (e.g. 3.0.1) PDF A/1 export seems to produce invalid PDF-files (Adobe Reader 9 complains about an invalid colorspace). Luckily a "normal" PDF-export seems to work fine these days, and also seems to include all the fonts I need for printing...

Mac

MacOS X natively supports printing as PDF from within any application. When printing, select PDF and then Save as PDF-X. This will produce a PDF/X compliant file which is suitable for device-independent printing, and therefore has to have all fonts embedded.

Windows

You can use the excellent and free PDFCreator to print as PDF from within any application. When printing, select PDFCreator as the printer. When printing, a dialog comes up that allows you to enter metadata (title, author, etc.). Click Options, then click Formats and select PDF. Select the Fonts tab, and make sure the "Embed all fonts" option is selected. For best printing-results, all image-compression-options should also be deselected in the Compression tab. Newer versions of PDFCreator also have an option for creating PDF/A compliant files. I haven't tested it though.

Checking your PDF-file

As most people use Adobe Acrobat or Adobe Reader to print PDFs, it's always a good idea to open the file in Adobe Reader and check for layout-problems. On Ubuntu, you can install Adobe Reader from the Medibuntu repository. You can also see which fonts are embedded by clicking File > Properties > Document Properties > Fonts. All fonts should have "Embedded" or "Embedded Subset" listed after the font name. In Ubuntu and other Linux-distros you can also use the pdffonts command to list all fonts in a PDF-file. Embedded fonts have "yes" in the "emb" column.

Embedding fonts into an existing PDF-file

In Ubuntu: Make sure you install all fonts that you want to embed. Here I have listed some tips for installing fonts in Ubuntu. You can use Ghostscript to create a new PDF-file that has all fonts embedded. The easiest way is to use Ghostscript's internal PDF-reader to convert the file:

This usually works fine, but Ghostscript's PDF parser is known to sometimes mess up graphics. To avoid this, you can first use the tool pdftops that comes with Poppler/Xpdf (packages poppler-utils and/or xpdf-utils) to convert the PDF-file to PostScript:

In Windows: Make sure you have all fonts installed. If you have Adobe Acrobat, you can open the PDF file and use Tools > Advanced Editing > Touch Up Text Tool. Select the text that uses a non-embedded font, right-click and select Properties. Select the font you would like to embed and then save the document. With recent versions of Acrobat you can use the Preflight tool to convert PDFs to PDF/X or PDF/A compliant files (Options > Convert Current PDF To PDF/X).