EPSTOOL - Create or extract preview bitmaps in EPS files.
Release date: 2000-12-27
Epstool is a utility to create or extract preview images in EPS files.
If you have precompiled executables, epstool.exe is a Win32 console EXE, epstool2.exe is an OS/2 console EXE.
Features:
Usage: epstool [option] operation filename
Options: | |
-b | Calculate BoundingBox from image |
-gcommand | Ghostscript command |
-nnumber | Page number to extract |
-ofilename | Output filename |
-q | Quiet (no messages) |
-rnumber | Preview resolution in dpi |
-sWIDTHxHEIGHT | Size of page used with -b |
-zdevice | Ghostscript device name (for -t6u, -t6p, -tg, -w) |
-d | Debug mode (leave temporary files) |
Operations: (one only) | |
-i | Add Interchange preview (EPSI) |
-t4 | Add TIFF4 preview (DOS EPS) |
-t6u | Add TIFF6 uncompressed (DOS EPS) |
-t6p | Add TIFF6 packbits (DOS EPS) |
-tg | Add GS TIFF preview (DOS EPS) |
-w | Add WMF preview (DOS EPS) |
-ufilename | Add user supplied preview (DOS EPS) |
-p | Extract PostScript (DOS EPS) |
-v | Extract Preview (DOS EPS) |
-c | Copy without preview (use with -b) |
Create EPS file tiger.eps with TIFF (G3 Fax) preview
epstool -tg -ztiffg3 -g"gswin32c -Id:\gs;d:\psfonts" -otiger.eps tiger.ps
Any GS TIFF device can be used, e.g. -ztiffg4, -ztiffpack
Add colour preview (8bit/pixel) to EPS file
epstool -t6p -zbmp256 -g"gswin32c -Id:\gs;d:\psfonts" -otiger.eps tiger.ps
Extract TIFF preview from tiger.eps
epstool -v -otiger.tif tiger.eps
EPS file has incorrect %%BoundingBox.
Add TIFF4 preview and calculate %%BoundingBox from bitmap.
epstool -b -t4 -g"gswin32c -Id:\gs;d:\psfonts" -ogolfer.eps golfer.ps
Adjust the BoundingBox of an existing EPS file, but don't add a preview:
epstool -b -t4 -otemp.eps existing.eps
epstool -p -oexisting.eps temp.eps
del temp.eps
or
epstool -b -c -otemp.eps existing.eps
del existing.eps
rename temp.eps existing.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 -ulogo.wmf -ologo2.eps logo.eps
When extracting a page number with "-n", it is your responsibility to make sure that the PostScript file does not use any operators that are forbidden in EPS files. This can be tested with GSview "EPS Warn".
Under OS/2 or MS-DOS, epstool requires Ghostscript 3.51 or later. If you have command line length problems, try setting the Ghostscript include path using the GS_LIB environment variable instead of using -g"c:\gs3.51\gswin32c.exe -Ic:\gs3.51;c:\gs3.51\fonts;c:\psfonts"
For Windows 95 or Windows NT, use gswin32c.exe. If you installed Aladdin Ghostscript using the self installer, epstool should automatically find the latest Ghostscript command line executable. For OS/2, use gsos2.exe. For MS-DOS, use gs386.exe.
The "-b Calculate BoundingBox from image" option works by scanning a bitmap returned by Ghostscript. This will only work for the operations -i, -t4, -t6u, -t6p, -w and -c. It does not work with -tg or -ufilename. -tg does not return a bitmap in a format understood by epstool. -ufilename does not even use Ghostscript. The bitmap size normally used is 216mm wide (letter width) by 297mm high (A4 height). If the DSC comments specify a default page size using %%DocumentMedia or %%PaperSize, then this page size will be used instead. Any marks made outside this area will be ignored when calculating the bounding box. To use a different bitmap size, specify the size in pts (1/72") using -sWIDTHxHEIGHT. For example, A3 is -s1190x842.
The "-zdevice" should only be used with -tg, -t6u, -t6p and -w.
For -tg, the -zdevice may be any TIFF device.
For -t6u, -t6p and -w: Under OS/2 or MS-DOS, -zdevice can be one of the following: bmpmono, bmp16, bmp256, bmp16m, pbmraw, pgmraw, ppmraw Under Unix, -zdevice can be one of the following: pbmraw, pgmraw, ppmraw
To get a colour preview, you must use -zdevice. The default device used by epstool is monochrome (bmpmono or pbmraw).
When adding a WMF preview using -w, the preview contains a bitmap,
not a vector representation. If -zdevice is not used, the
Ghostscript device bmpmono or pbmraw will be used to create the bitmap.
The bitmap in the metafile will be 1bit/pixel black and white.
epstool -b -w -onew.eps old.eps
If you want a colour bitmap in the metafile, specify a bitmap device
which supports colour.
epstool -b -w -zbmp256 -onew.eps old.eps
When adding a WMF preview to an EPS file using -ufilename, 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 it's origin at (0,0), which might not be correct.
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-2000, Ghostgum Software Pty Ltd. All rights reserved.
This file is part of GSview.
This program is distributed with NO WARRANTY OF ANY KIND. No author or distributor accepts any responsibility for the consequences of using it, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Refer to the GSview Free Public Licence (the "Licence") for full details.
Every copy of GSview must include a copy of the Licence, normally in a plain ASCII text file named LICENCE. The Licence grants you the right to copy, modify and redistribute GSview, but only under certain conditions described in the Licence. Among other things, the Licence requires that the copyright notice and this notice be preserved on all copies.
Author: Russell Lang, Ghostgum Software Pty Ltd
Internet: gsview at ghostgum.com.au
Other tools that can add previews to EPS files are
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.