EPSTOOL - Create or extract preview images in EPS files.
Release date: 2005-06-10
Epstool is a utility to create or extract preview images in EPS files.
Features:
Usage: epstool command [options] input_filename output_filename
Commands (one only):
--add-tiff6p-preview or -t6p --add-tiff6u-preview or -t6u --add-tiff4-preview or -t4 --add-tiff-preview or -tg --add-interchange-preview or -i --add-metafile-preview or -w --add-pict-preview --add-user-preview filename --dcs2-multi --dcs2-single --dcs2-report --extract-postscript or -p --extract-preview or -v --bitmap --copy --dump --test-eps --help or -hOptions:
--bbox or -b --combine-separations filename --combine-tolerance pts --custom-colours filename --debug or -d --device name --doseps-reverse --dpi resolution --dpi-render resolution --ignore-information --ignore-warnings --ignore-errors --gs command --gs-args arguments --mac-binary --mac-double --mac-rsrc --mac-single --missing-separations --page-number page --quiet --rename-separation oldname newname --replace-composite
One of the following commands must be specified. Trying to use more than one command isn't helpful.
The Macintosh does not use a flat file system. Each file can have a data fork and a resource fork. EPSF files have the PostScript in the data fork, and optionally have a preview in the resource fork as a PICT image. In addition, file type is obtained from the finder info rather than a file extension. File types use a four character code such as "EPSF" or "PICT". When Macintosh files are copied to a foreign file system, the resource fork may be left behind. Alternatives to retain the resource fork are to package the finder data, data fork and resource fork in a single MacBinary or AppleSingle file, or to put the data fork in a flat file and the finder info and resource fork in an AppleDouble file. The Mac OSX finder will handle AppleDouble files automatically when copying files to and from a foreign file system. When copying test.eps to a foreign file system, the data fork would be written as test.eps and the finder info and resource fork to the AppleDouble file ._test.eps or .AppleDouble/test.eps.
Epstool can read MacBinary and AppleSingle files. It can write MacBinary I, AppleSingle, AppleDouble or Resource files. Files written by epstool will have type EPSF and creator MSWD. When adding a preview to test.eps, it is suggested that you create the MacBinary file test.eps.bin. On a Macintosh computer you then need to extract it with StuffIt Expander. Another alternative is to write the AppleDouble file to ._test.eps then copy both files to a file system accessible to a Mac computer.
If the output file name starts with . then AppleDouble will be assumed, otherwise if it ends with .as then AppleSingle will be assumed, otherwise if it ends with .rsrc or /rsrc then Resource will be assumed, otherwise MacBinary will be assumed. When writing a MacBinary file, it is recommended that you end the filename in .bin. To force the file type, use --mac-single, --mac-double, --mac-binary or --mac-rsrc.
On Mac OS X you can access a file's resource fork from command line tools by appending /rsrc to the original file name. The easiest way to add a preview to the file test.eps on Mac OS X is to let epstool write in --mac-rsrc format to test.eps/rsrc (see Examples).
The Desktop Color Separation (DCS) image file format contains a low resolution preview, a main file with the full resolution composite image, and colour separations with full resolution separated plates. The separations will typically contain Cyan, Magenta, Yellow, Black and possibly spot colours. There are two versions of DCS 2.0.
Epstool can add previews to single and multiple file DCS 2.0. It can split single file DCS 2.0 into multiple files and vice versa. This allows a single file DCS 2.0 to be split, the composite image replaced, a new preview created, and then be recombined into a single file.
Some DCS 2.0 files do not have an image in the composite page. To determine if the composite page does not contain an image, use --dcs2-report and look to see if the composite section is very short. Using --dcs2-single --replace-composite replaces the composite page with the headers of the original composite page and a body containing a CMYK image derived from the separations. Set the resolution of the CMYK image using --dpi.
When replacing the composite page with a CMYK image using --replace-composite, the --custom-colours option is useful for dealing with DCS 2.0 files that have incorrect CMYK colours, for example specifying that the varnish layer is grey. Each line of the CMYK colours file is formatted like a DSC %%CMYKCustomColor: or %%RGBCustomColor: line, as shown in the example below.
%%CMYKCustomColor: 0.00 0.00 0.00 0.00 Varnish %%CMYKCustomColor: 1.00 0.68 0.00 0.12 (Dark Blue) %%RGBCustomColor: 0.5 0.0 0.0 (Dark Red)
DCS2 files should not have two separations with the same name. Epstool will not allow a DCS2 output file to have duplicate separation names. Use --rename-separation to resolve this.
Add colour preview (24bit/pixel) to EPS file
epstool -t6p tiger.eps output.eps
Add TIFF (G3 Fax) preview to tiger.eps.
epstool --add-tiff-preview --device tiffg3 tiger.eps output.eps
Any GS TIFF device can be used, e.g. tiffg4, tiffpack
Extract TIFF preview from tiger.eps
epstool -v tiger.eps tiger.tif
Fix incorrect %%BoundingBox then add TIFF4 preview.
epstool --bbox -t4 golfer.eps output.eps
Adjust the BoundingBox of an existing EPS file, but don't add a preview:
epstool --copy --bbox input.eps output.eps
Add user supplied Windows Metafile to EPS file.
Typically used when an application can export EPS and WMF separately
but can't export EPS with WMF preview.
epstool --add-user-preview logo.wmf logo.eps output.eps
Add a PICT preview and write an AppleDouble file.
epstool --add-pict-preview --mac-double tiger.eps ._tiger.eps
To be used by a Mac, both tiger.eps and
._tiger.eps need to be on a foreign file system
accessible to the Mac.
On Mac OS X you can access a file's resource fork from command line
tools by appending "/rsrc" to the file's original name.
Add a PICT preview, overwriting the existing resources.
epstool --add-pict-preview --mac-rsrc tiger.eps tiger.eps/rsrc
When adding a WMF preview to an EPS file using -add-user-preview filename, the placeable metafile header is removed from the metafile as it is put into the EPS file. When extracting a WMF preview from an EPS file, a placeable metafile header is created from the EPS BoundingBox information. This placeable metafile header assumes that the WMF has its origin at (0,0), which might not be correct.
When epstool is creating a TIFF or WMF preview, it will convert palette colour images into 24-bit/pixel.
The environment variable TEMP should point to a writeable directory for temporary files. If not defined, /tmp will be used for Unix and the current directory will be used for other platforms.
Copyright (C) 1995-2005 Ghostgum Software Pty Ltd. All rights reserved.
This software is provided AS-IS with no warranty, either express or implied.
This software is distributed under licence and may not be copied, modified or distributed except as expressly authorised under the terms of the licence contained in the file LICENCE in this distribution.
For more information about licensing, please refer to http://www.ghostgum.com.au/ or contact Ghostsgum Software Pty Ltd, 218 Gallaghers Rd, Glen Waverley VIC 3150, AUSTRALIA, Fax +61 3 9886 6616.
Author: Russell Lang, Ghostgum Software Pty Ltd
Internet: gsview at ghostgum.com.au
To compile epstool on Unix, use
make -f src/epstool.mak
To build an RPM
rpmbuild -ta epstool-N.NN.tar.gz
To compile epstool on MS-Windows, use
nmake -f srcwin/epstool.mak VCVER=71
Other tools that can add previews to EPS files are
Fix Unix-like makefiles to work with non-GNU make.
Install CSS file gsview.css.
Added --ignore-information to ignore DSC parser information messages.
Fixed handling of --ignore-warnings and --ignore-errors so that these
are now required to process files with warnings or errors.
Added makefile support for cygwin packages.
Added --test-eps making a partial test of EPS compliance.
Added --dump for displaying summary of DSC information.
Builds as Win64 for AMD64, using either Microsoft Visual Studio .NET 2003
with Windows Server 2003 DDK, or with Microsoft Visual Studio .NET 2005
beta.
Builds under OS/2 with gcc/emx.
Fix portability issue for Unix-like systems without shared libraries.
Interchange preview was restricted to 1bit/pixel.
Add 8bit/pixel grey which isn't commonly used.
Explicitly set the page size when calculating the bounding box,
to avoid getting erroneous results when the user changes the
default page size with -sPAPERSIZE=a4 or by modifying gs_init.ps
to change the default page size on startup.
This was a problem with some badly configured Linux distributions.
Fix interchange previews which were inverted.
Fix --bitmap for EPS file without a page, which was broken
when --page-number was added.
Identify DCS 1.0 as itself, not DCS 2.0.
More portable on Unix-like systems.
Write duplicate DCS2 separations to unique files with --dcs2-multi.
When renaming a DCS2 separation, only rename the first occurence of the
name, to allow files with duplicate separation names to be fixed.
Do not allow duplicate separations in an output file. This must be
resolved with --rename-separations
Added --page-number to allow bitmaps of separations to be created.
Fix bitmap output to stdout with "--bitmap --output -".
Prevent crash when given a PDF file.
Put --gs-args near the end of the GS command line, to allow
PostScript commands to be embedded.
Fix bug that caused a crash with -t6p on non-Windows systems.
Allow output to stdout with filename "-".
Remove blank lines from interchange preview.
Rearrange files in the epstool distribution so that it compiles
with a simple 'make' on Linux.
Added Macintosh AppleDouble, AppleSingle, MacBinary and Resource formats,
and the ability to add/remove PICT previews.
Added --combine-separations and --combine-tolerance.
Allow spaces to occur in unquoted DCS1 separation file names.
Added man page and some build updates for Debian.
Added --doseps-reverse.
Added --rename-separation.
Added bounding box to --dcs2-report output.
Major rewrite.
Command line changes.
Use ghostscript bbox device for calculating bounding box.
Supports multiple file DCS 2.0.
Add preview to single file DCS 2.0.
Replace composite page of DCS 2.0 with an image derived from
the separations.
Down sample images to provide anti-aliasing.
Removed option to extract a page from a multipage file. The input
file must now be EPS.
Release with GSview 4.3.
Fixed bug in extracting a page.
Handle single file DCS 2.0.
Added '-k' to create a bitmap of the EPS.
Release with GSview 4.2.
Release with GSview 4.1.
Remove %%BoundingBox from trailer when adding it to header.
Release with GSview 4.05 beta.
Added -aargs to separate arguments from -g.
This is needed because program name is surrounded by
quotes and so some shells were treating the arguments
as part of the program name.
Release with GSview 4.03 beta.
Release with GSview 4.01 beta.
Ignore DSC warnings with -e1, ignore DSC errors with -e2.
Release with GSview 4.0.
Allow DSC warnings to be ignored with -e.
Release with GSview 3.6.
Write correct page ordinal when extracting a page.
Correctly handle DOS EPS files again.
Release with GSview 3.5.
Updated DSC parser.
Release with GSview 3.41 beta.
Fixed handling of files without trailers.
Put quotes around Ghostscript EXE name for Windows, OS/2 and Unix. Released with GSview 3.1.
Minor fixes for Linux build.
Release with GSview 3.0.
Fixes to DSC parser.
New DSC parser.
Added #pragma pack(1) needed by MSVC++.
Modified BMP reading so it works even if byte packing not used.
,
BMP reading might now work with big-endian architectures, so
might be able to use BMP devices on Unix (if compiled into Ghostscript).
(Untested).
Fixed incorrect switch statement in psfile_extract_header()
Fixed -b -c to change the first line to EPS.
Added -sWIDTHxHEIGHT for use with -b -c and large page sizes.
Cope with badly written EPS files that leave items on the stack or dictionary stack.
Page calculation for descending page order was wrong.
If a multipage non-EPS file was used as input, the output
didn't contain the correct single page (or copied garbage).
Added macro for SUNOS4 to use bcopy instead of memmove.
When calculating the bounding box from a bitmap, round the area outwards by 0.5 pixels.
Released with GSview 2.4
TIFF4 preview didn't work from 24bit/pixel source bitmap.
TIFF 6 packbits didn't compress properly for some data (and
consquently caused heap corruption).
Fixed TIFF 6 output when using palette (4 or 8 bit/pixel).
Removed requirement for EPS file to use showpage.
Added -c to allow correction of %%BoundingBox
When calculating %%BoundingBox, render to a page of letter
width and A4 height.
Avoid integer overflow on 16bit machines when calculating width
and height.
If TEMP undefined, default to /tmp on Unix.
Release separate from GSview. No code changes.
Includes Win32 (epstool.exe) and OS/2 (epstool2.exe) EXEs.
Not a beta version. Included with GSview 2.1.
Added TIFF packbits compression.
Added -zdevice.
-t5 replaced by -t6u, -t6p.
-wdevice replaced by -w -zdevice
-ttiff3 replaced by -tg -ztiffg3
Makefile target for Win32.
Add WMF for all platforms.
Removed restriction that structures must be byte aligned under Unix.
Must still be byte aligned under DOS and OS/2.
Fixed a few error messages.
Use @file to reduce Ghostscript command line length under MS-DOS and OS/2.
Added -q option to GSview and -dQUIET option to Ghostscript command line
to allow EPS files to be written to stdout.
Delete temporary bmp file.
Add user supplied preview to a DOS EPS file (which already had a
preview) was wrong.
Put stdout into binary mode.
Write placeable WMF header correctly on 32bit and big-endian machines.
Remove placeable WMF header when adding to EPS file, add placeable
WMF header when extracting from EPS file.
First release separate from GSview.