A multiplatform GUI- and command-line converter for [e]ps and pdf.
Siep Kroonenberg,
siepo at cybercomm
dot nl
Current online version of this page
Epspdf has been created with TeX in mind. For TeX and its derivatives, eps and pdf are the preferred graphics formats.
Ghostscript can convert PostScript to pdf. However, few people are prepared to deal with the ghostscript command-line. Several command-line utilities try to help out, e.g. epstopdf, a2ping, and the convert utility from ImageMagick. But for most users this is still not good enough.
Epspdftk adds a GUI, with buttons to select options and with dialogs for opening and saving files.
A lot more can be done if you can round-trip between PostScript and pdf. Although Ghostscript can go from pdf to PostScript, pdftops does a much better job converting text back to PostScript. This opens several new possibilities: grayscaling and computing a better boundingbox for either eps- or pdf graphics, and page selection from multipage PostScript- and pdf documents. Epspdf will use pdftops if it can find it, and silently does whatever back-and-forth conversions are necessary.
The command-line program epspdf is written in Ruby. Epspdftk, its GUI companion, in Ruby/Tk.
Starting with the 2008 edition, epspdf is included in TeX Live as an optional package, complete with wrappers epspdf and epspdftk which can be called from the command-line without further ado.
These are the required and optional prerequisites, which will be checked for when epspdf starts:
You may not have to install all of these yourself.
On a current Linux distribution you can almost certainly install everything from your distribution's package repositories. Ruby's Tk bindings may be in a separate package, with a name such as libtcltk-ruby. As to PostScript- and pdf viewers: epspdf tests for several popular viewers, but the configuration screen also lets you specify viewers manually.
Ruby, Tcl/Tk and Ruby/Tk are already part of Tiger and Leopard.
Ghostscript is included in MacTeX, but is also available via e.g. MacPorts.
You can get pdftops from MacPorts as part of either Poppler or xpdf. Another source is http://users.phg-online.de/tk/MOSXS/. If you want to compile xpdf it yourself, which is not hard, you can ignore warnings about X, Motif or FreeType not being found since these missing libraries won't affect the compilation of pdftops.
For Ghostscript and pdftops, see above.
Unfortunately, in Snow Leopard Ruby's Tk bindings went missing, so the GUI interface won't work with the built-in Ruby; see below. If you compile Ruby yourself from source you get the Tk interface automatically. Call configure with a --enable-pthread option.
Snow Leopard's built-in Ruby is fine for command-line use and on-the-fly conversions.
By itself, Windows lacks any of the prerequisites of epspdf. However, a TeX installation may fill some of the gaps, and there is a special Windows installer which includes a partial Ruby installation. See the table below:
TeX distribution | Installer | Zipfile |
---|---|---|
(1) MikTeX and TeX Live ≥ 2008 include a hidden Ghostscript which is always installed, and which epspdf knows how to find. Caveat: although older versions of TeX Live include a Ghostscript installer, it is not impossible to install an older TeX Live without Ghostscript, in which case you have to provide a Ghostscript yourself. | ||
(2) With TeX Live ≥ 2008, you are better off installing the TeX Live package, which also gives you wrappers for epspdf and epspdftk for use on the command-line and for on-the-fly conversions. You still need to install Ruby 1.8 and Tcl/Tk. | ||
TeX Live(1) | No additional requirements | Ruby, Tcl/Tk(2) |
MiKTeX | Pdftops (optional) | Pdftops (optional); Ruby 1.8, Tcl/Tk(optional) |
Other/None | Ghostscript, pdftops (optional) | Ghostscript; pdftops(optional), Ruby 1.8, Tcl/Tk (optional) |
At the moment, the Ruby Tk interface is not as readily available as it has been: at some time during the 8.4 cycle, the Windows Ruby one-click installer dropped Tcl/Tk, and aimed instead to hook up to any already-installed Tcl/Tk. As to Ruby 1.9: at the moment I know of no easy-to-use installer on Windows which includes a Tk interface library. On Mac OS X 10.6 (Snow Leopard) the Ruby Tk interface library also went missing, although both Ruby and Tcl/Tk are still included.
I am working on a pure Tcl/Tk interface, i.e.a Tcl/Tk script which calls epspdf as a program, not as a library, but I can give no ETA. This will eliminate dependence on a Ruby/Tk interface library.
First make sure that the prerequisites are met. Then:
Use TeX Live's package manager tlmgr for installation.
Download the epspdftk setup program. You can run it in the usual way, by double-clicking. The setup program will create entries in your start menu for epspdftk and for the user manual.
Download the epspdf zip file, unpack it somewhere and create a shortcut for epspdftk.rbw. If you plan to use the command-line version, put a batchfile in a directory on your path with the line
"<path_to_ruby.exe>" "<path_to_epspdf.rb>" %*
Similarly for epspdftk. With such a batchfile, the caller has to take care of quoting:
epspdf "my file.eps" "my file.pdf"
Epspdf[tk] has been tested with Windows 2000, Windows XP and Windows 7.
Download the tar.gz archive and unpack it in some directory. All files should be in the same directory; that is how they find each other. If you plan to use epspdf.rb from the command-line, then create a shell script epspdf such as
#!/bin/sh <path_to_epspdf>/epspdf.rb "$@"
and put it somewhere on your path.
You can do the same for epspdftk. The first command-line parameter will be interpreted as startup directory for the file browser.
You can install as for Unix/Linux. Here, too, all files should be in the same directory.
There is also a compressed disk image epspdf.x.x.x.dmg.gz which
wraps epspdftk into a Max OS X app
. Double-click once to
expand, a second time to mount, then drag epspdftk.app to the
Applications folder. The current version has been created and tested
with Leopard. As pointed out above, under Snow
Leopard the GUI program epspdftk will not work without a third-party
Ruby/Tk.
Epspdf mostly duplicates functionality of Preview. But having an alternate conversion engine means that you can have another shot at problem files.
Epspdftk will use the default Windows programs for PostScript and
pdf. If you have TeX Live 2008 or later then you can assign <TeX
Live root>\bin\win32\psv.bat as previewer for .ps- and .eps
files. For Windows only, there is an additional View
with...
button to select a viewer yourself.
Supported PostScript viewers include evince, gv, gsview and okular. These are also listed as pdf viewers. Additional pdf viewers are xpdf, gpdf, epdfview and acroread/Adobe Reader. You can also specify a previewer manually in the configuration screen; see the user manual..
Epspdftk will always use the default pdf viewer under OS X, usually Preview or Adobe Reader.
View with...button; support for MikTeX's built-in Ghostscript; streamlined Ruby subset, with Tcl/Tk compiled from source.
Last revised: Januari 27, 2010