Epspdf and epspdftk User Guide

A multiplatform GUI- and command-line converter for [e]ps and pdf.

Siep Kroonenberg,
siepo at cybercomm dot nl

Overview

Epspdftk converts files between eps, pdf and general PostScript. The main screen lets you open a file, select some options and convert the file.

When opening a file, epspdf tries to find out file type and, in the case of a pdf file, the number of pages. This information is displayed in the box in the upper half of the screen.

Viewing

The View button at the bottom of the screen calls an appropriate external viewer. For Windows this is determined by the default Open command, for OS X it is always Preview, and under Linux it is configurable; see below under The Configuration screen.

The View button is grayed if epspdf thinks that there is no previewer for the current file.

Conversion options

Grayscaling: Simple color figures can be converted to grayscale. Grayscaling will fail for bitmapped data and for advanced color models. 'Try harder to grayscale' will handle a few more cases, but may take longer and still won't handle bitmaps.

Call for assistance: If a PostScript color expert is reading this: please have a look at makegray.pro and see whether you can come up with something that handles more color models.

Compute tight boundingbox: This option is only available if a single page is converted.

Page selection: The only possibilities are selecting a single page or selecting all pages. When converting to eps you are restricted to a single page.

For general PostScript files, there is no quick way to determine the number of pages, so the program won't check beforehand whether you picked an existing page. If you picked a non-existent page, the program will abort. If you don't like that, convert the entire document to pdf first - which will be done behind the scenes anyhow.

Specifying options such as grayscaling or page selection may require several roundtrips between PostScript or eps and pdf. If epspdf cannot use pdftops then some combinations of options will not be available.

Converting

The Convert and save... button calls up a file save dialog, with appropriate default extension. After a successful conversion, the result becomes the new current file, so you can judge the result by pressing the View button again.

The configuration screen

Epspdftk also has a configuration screen. The settings here are preserved between sessions. Pay particular attention to 'Intended use' under PDF CONVERSION. Choose 'prepress' for pdfs which are intended for commercial printing. This option will try to embed all fonts, among other things. More and more often, printshops insist on this. With luck, Ghostscript fonts and system fonts will be used for fonts which were not originally embedded.

Under Windows, this screen also lets you tell the program where to find pdftops.exe. Under Linux, it lets you pick PostScript- and pdf previewers.

Adding standard fonts to an existing pdf

You can add standard fonts such as Times and Helvetica to an existing pdf: first, convert to ps, with 'Convert all pages' selected. Then, make sure that in the configuration screen 'Intended use' is set to prepress, then convert back to pdf.

If this option is set to screen, then standard fonts will be removed instead of added. This option may also affect the resolution of bitmaps.

Eps preview headers

Preview headers are quietly stripped from eps files. These preview headers are used by e.g. desktop-publishing software to represent eps files on screen without having to interpret the PostScript code itself. Epspdf currently has no option to preserve or add them.

Exporting PostScript from Windows programs

Often, the only way to get EPS or PostScript from a Windows program is by 'printing' to a PostScript file. From some programs, you can print a selection. A suitable driver which comes with Windows is Generic / MS Publisher Imagesetter. Pay attention to the printer properties: avoid the 'Optimize for speed' setting and choose Outline for font downloading. These options can be found under the Advanced button.

Other possibilities are the TpX and wmf2eps programs, which both have options to write clipboard contents to an emf file. Wmf2eps uses a printer driver in the background. For faithful conversion, pick wmf2eps; for subsequent editing, choose TpX. Both programs are availbable from CTAN.

Command-line use

Epspdf.rb, the library for epspdftk.rb, does double duty as command-line version of epspdftk.rb. Type epspdf.rb -h for help. It shares configuration settings with epspdftk.

Troubleshooting

Grayscaling fails

See above, under Grayscaling. Epspdf is limited by what can be done by the backend tools, i.e. Ghostscript and pdftops.

Part of the graphic gets cut off

I have seen this happen with eps files generated by printing landscape PowerPoint slides to PostScript with the Encapsulated PostScript output option. Using the Archive output option instead solved the problem. In general, experiment a bit in generating your PostScript.

Resources for troubleshooting

Logfile. Epspdf and epspdftk maintain a log file epspdf.log in your home directory or, in case of Windows, your profile directory. This profile directory may be c:\Documents and Settings\<your user name>. Otherwise, open a DOS box and type 'echo %USERPROFILE%', which will produce this information.

This logfile lists all Ghostscript- and pdftops program calls plus error information. 'EPCallError' is probably a program error. 'EPSystemError' is more likely caused by a faulty file, but may be a program error as well.

Temporary files. The temporary files may give clues as well. They will be deleted at the end of the session (for the command-line version, give a -d parameter to keep the temporary files). Check the logfile which temporary files have been created.

Main page...


Last revised: Noverber 20, 2006