# Epspdf and epspdftk

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

Siep Kroonenberg,
`siepo at cybercomm dot nl`

Current online version of this page

Legacy Ruby-based versions

## Table of Contents

- Features
- Introduction
- Prerequisites
- Installation
- Files
- Releases

## Features

- Distiller
- Works both for documents and for graphics
- Single-page selection
- Also converts from pdf back to PostScript and eps
- Removal of preview headers from eps files
- Cropping extra whitespace
- Grayscaling
- GUI- and command-line use
- GUI-configurable preferences
- Multiplatform: works unchanged on Windows and Unix/Linux
- Support for TeX Live and MiKTeX

## Introduction

For TeX and its derivatives, eps and pdf are the preferred graphics formats. Epspdf and epspdftk can convert between these, with various conversion options, and can also handle PostScript files which aren't eps files. PSTricks users may appreciate the capability to go from pdf back to PostScript.

Epspdftk is the GUI component, with buttons to select options and with file dialogs for opening and saving files.

Epspdf is the command-line component, which is used by epspdftk but can also be used on its own. It uses Ghostscript, luatex and optionally pdftops to do the real work. Multistep conversions extend the possibilities.

Conversion options include grayscaling, page selection, computing a tight boundingbox and some pdf options.

The third-party LaTeX package epspdfconversion uses epspdf for on-the-fly conversion of eps graphics to pdf, with options to control grayscaling and boundingbox generation. See CTAN or your TeX distribution.

The command-line program epspdf is written in texlua, which is part of recent versions of MikTeX and TeX Live. Versions prior to 0.6 were written in Ruby. Epspdftk, its GUI companion, is written in in Tcl/Tk.

Starting with the 2008 edition, TeX Live includes epspdf in some form as an optional package.

## Prerequisites

These are the required and optional prerequisites, which will be checked for when epspdf starts:

- A somewhat recent TeX installation, either TeX Live or MiKTeX. If this is not an option, get a legacy version of epspdf instead.
- Ghostscript. This is already part of MiKTeX and of TeX Live for Windows, and packaged for most Linux distributions.
- Optional: pdftops from the xpdf suite or from the Poppler utilities, or as a package from your Linux distribution. Pdftops may do a better job than Ghostscript of preserving scalable fonts when converting from pdf to ps, although Ghostscript is steadily improving in this respect. Included in TeX Live for Windows and in recent versions of MiKTeX. If you have an old MiKTeX and a copy of pdftops.exe, then you can point epspdf to this file from within the GUI. You need to do this only once.
- Tcl/Tk for the GUI interface. Version 8.6 has been tested. Packaged for many or most Linux distributions, and also available from ActiveState. Alternatively, a single-file TclKit runtime will do. The TclKit page contains various links to precompiled binaries.
- Optional: viewers for PostScript and pdf

## Installation

If you have a sufficiently recent standalone TeX Live and have a Tcl/Tk installation or runtime, just install the TeX Live package. Otherwise:

### Unix/Linux

Unpack the archive somewhere and create symlinks to epspdf.tlu and epspdftk.tcl in a directory on your searchpath.

### Windows setup program

This is a conventional Windows installer. If it does not find texlua.exe on the searchpath then it gives a warning and a opportunity to abort. Note though that texlua only needs to be available at runtime. It creates a shortcut to the epspdftk GUI and it also creates an uninstaller.

It installs epspdftk in the form of a so-called starpack, which consists of the epspdftk script and a Tcl/Tk runtime, combined into a single executable. The Tcl/Tk 8.6 runtime is from Patrick Thoyts’ bleeding edge builds. The command-line script epspdf.tlu remains a separate file.

This installer has been created with NSIS on Linux.

### Windows zipfile

Download the epspdf zip file, unpack it somewhere and create a batchfile epspdf.cmd such as

    texlua "<path_to_epspdf.tlu>" %*

for epspdf.tlu, and a batchfile epspdftk.cmd

    wish "<path_to_epspdftk.tcl>" %1

for epspdftk.tcl. The wish executable might also be named wish85[.exe] or wish86[.exe], or tclkit[.exe] if it is a single-file Tcl/Tk runtime. The first command-line parameter will be interpreted as startup directory for the file browser. Make sure that wish and these batchfiles are on your searchpath.

The current epspdf[tk] has been tested with Windows 7 and Windows 10.

## Files

- epspdf.0.6.3.tgz preferred for Unix and Mac OS X
- epspdf.0.6.3.zip preferred for Windows if you don't want to use the installer below
- epspdf.0.6.3.exe Windows setup program which installs epspdf with a built-in Tcl/Tk runtime: no dependencies beyond a TeX Live- or MiKTeX installation.

## Releases

- 0.6.3 Current version. The LuaTeX code which is generated for some pdf-to-pdf conversions (page selection and cropping) is now compatible with LaTeX versions through 0.95 and should work with TeX Live 2016 and earlier.
- 0.6.2 Small compatibility fix for luatex ≥ 0.81.
- 0.6.1 Bug fixes, see Changelog; support for later Ghostscript versions.
- 0.6.0 First release of luatex version.
- Legacy Ruby-based versions

Last revised: May 2, 2016