PSTOEDIT

Section: User Commands (1)
Updated: 971204
Index
 

NAME

pstoedit - a converter from PostScript and PDF to editable objects or vector graphic formats  

SYNOPSIS

pstoedit [-help]

pstoedit [-dt] [-dis] [-merge] [-df fontname] [-flat number] [-nomaptoisolatin1] [-nq] [-s factor] [-psargs string] [-include includefile] -f format[:options] [inputfile [outputfile]]

pstoedit [-s factor] -f format[:options] -bo inputfile [outputfile]

 

DESCRIPTION

 

RELEASE LEVEL

This manpage documents release 2.5.1 of pstoedit.  

USE

pstoedit converts PostScript and PDF files to a simple vector graphic format that can be edited or imported into various drawing packages. Type

pstoedit -help
to get a list of supported output formats.

pstoedit works by redefining the two basic painting operators of PostScript, stroke and show. Other drawing operators (e.g. image) are not supported. After redefining these operators, the PostScript or PDF file that needs to be converted is processed by a PostScript interpreter, e.g., Ghostscript (gs). You normally need to have a PostScript interpreter installed in order to use this program. However, you can perform some "back end" processing of prepared files by specifying the -bo option for debugging or limited filtering. See "BACK END-SPECIFIC OPTIONS" below.

The output that is written by the interpreter due to the redefinition of the drawing operators is a sort of 'flat' PostScript file that contains only simple operations like moveto, lineto, show, etc. You can look at this file using the -f debug option.

This output is read by end-processing functions of pstoedit and triggers the drawing functions in the selected back end driver, or backend.

 

NOTES

If you want to process PDF files directly, your PostScript interpreter must provide this feature, as does Ghostscript. Aladdin Ghostscript 4.03 or later is recommended for processing PDF (and PostScript Level 2) files.

 

OPTIONS

-dt
Text is drawn as polygons. This might produce a large output file. You might want to use this options for example if the PostScript file contains text and the backend does not support this, e.g. gnuplot.
-dis
Open a display during processing by Ghostscript. Some files only work correctly this way.
-psargs string
The string given with this option is passed directly to Ghostscript when Ghostscript is called to process the PostScript file for pstoedit. For example: -psargs "-r72x72" This causes the resolution to be changed to 72x72 dpi. (Changing the resolution this way has an effect only if -display is set. Otherwise the default resolution of 1 point (72 dots per inch) is used.)

You can switch Ghostscript into PostScript Level 1 only mode by -psargs "level1.ps". This can be useful for example if the PostScript file to be converted uses some Level 2 specific custom color models that are not supported by pstoedit. However, this requires that the PostScript program checks for the PostScript level supported by the interpreter and "acts" accordingly.

If you want to pass multiple options to Ghostscript you must enclose all options with quotes, e.g. -psargs "opt1 opt2 opt2". See the gs(1) manpage for other possible options.

-merge
Some output formats permit the representation of filled polygons with edges that are in a different color than the fill color. Since PostScript does not support this, drawing programs typically generate two objects (the outline and the filled polygon) into the PostScript output. pstoedit is able to recombine these, if they follow each other directly and you specify -merge.
-df fontname
Sometimes fonts embedded in a PostScript programs do not have a fontname. This for example happens in PostScript files generated by dvips. In such a case pstoedit uses a replacement font. The default for this is Courier. Another font can be specified using the -df option. -df Helvetica causes all unnamed fonts to be replaced by Helvetica.
-include name of a PostScript file to be included
This options allows to specify an additional PostScript file that will be executed just before the normal input is read. This is helpful for including specific page settings or for disabling potentially unsafe PostScript operators, e.g., file, renamefile, or deletefile.
-f format
target output format recognized by pstoedit. Currently format may be one of: debug, fig (Xfig), cgm, pdf, gnuplot, dxf, lwo, mif (Framemaker MIF, not MapInfo MIF), rib, rpl, java, ps, met (OS/2 only), wmf (Windows and Borland C++ only), tgif, idraw, and dump. See "BACK END-SPECIFIC OPTIONS" below for an explanation of the [:options] to -f format.
-s factor
scale by the specified bitmap display factor. (Use with -f tgif option only.)
-bo
You can run backend processing only (without the PostScript interpreter frontend) by first running pstoedit -f dump infile dumpfile and then running pstoedit -f format -bo dumpfile outfile.
-flat number
If the backend does not support curves in the way PostScript does, all curves are approximated by lines. Using the -flat option one can control this approximation. This parameter is directly converted to a PostScript setflat command.
-nq
No exit from the PostScript interpreter. Normally Ghostscript exits after processing the pstoedit inputfile. For debugging it can be useful to avoid this. If you do, you will have to type quit at the GS> prompt to exit from Ghostscript.
-nomaptoisolatin1
Normally pstoedit maps all character codes to the ones defined by the ISO-Latin1 encoding. If you specify -nomaptoisolatin1 then the encoding from the input PostScript is passed unchanged to the output.
inputfile
input file.
outputfile
output file. If no output file is given as argument, pstoedit writes the result to standard output.

If neither an input nor an output file is given as argument, pstoedit works as filter reading from standard input and writing to standard output.

 

BACK END-SPECIFIC OPTIONS

pstoedit allows you to pass individual options to a backend. This is done by appending all options to the format specified after the -f option. The format specifier and its options must be separated by a colon (:). If more than one option needs to be passed to the backend, the whole argument to -f must be enclosed within double-quote characters, thus:
-f "format:option option ..."

Currently met , java , dxf , and wmf are the only drivers accepting specific options. Other options may be asserted through environment variables. See "ENVIRONMENT VARIABLES" below.

The wmf driver supports two backend specific options, 'v' and 'e'.

-f wmf:v
turns on a verbose mode;
-f wmf:e
tells pstoedit to generate an enhanced metafile instead of a normal metafile.
-f "wmf:ve"
specifies both verbose mode and enhanced metafile output.

The java backend allows to specify the class name of the class that is generated by pstoedit. The default is PSJava. You can change this using

-f java:anothername

The dxf backend accepts the option -lines which forces all polygons and lines to be represented as LINEs in the generated DXF file. The default is to use POLYLINEs. Example:

-f "dxf:-lines"

The met backend allows the following single character options (without a leading -)

w - Draw into an opened window instead of a metafile
p - Draw no geometric linewidths, all lines have a width of zero
l - No filling of polygon interiors
c - No colors, just greyscales
t - Omit all text
g - Omit all graphics
v - Put verbose output to drvMET.out

Example:

-f "met:wlc"
 

NOTES

To implement a new backend you can start from drvsampl.cpp and drvsampl.h. See also comments in drvbase.h and drvfuncs.h for an explanation of methods that should be implemented for a new backend.

pstoedit can be configured at compile time to include support for CGM. In this case the cd-library from the CGM Draw package created by G. Edward Johnson of the United States National Institute for Standards and Technology (NIST) is needed. The cd-library and related documentation can be found at:

<URL:http://speckle.ncsl.nist.gov/~lorax/>

 

ENVIRONMENT VARIABLES

A default PostScript interpreter to be called by pstoedit is specified at compile time. You can overwrite the default by setting the GS environment variable to the name of a suitable PostScript interpreter.

You can check which name of a PostScript interpreter was compiled into pstoedit using: pstoedit -help.

See the gs(1) manpage for descriptions of environment variables used by Ghostscript most importantly GS_FONTPATH and GS_LIB; other environment variables also affect output to display, print, and additional filtering and processing. See the related documentation.

You can set the environment variable PSTOEDITVERBOSE to 1 to generate verbose output from pstoedit. Otherwise the default is 0, nonverbose.

pstoedit allocates temporary files using the function tempnam(3). Thus the location for temporary files might be controllable by other environment variables used by this function. See the tempnam(3) manpage for descriptions of environment variables used. On UNIX like system this is probably the TMPDIR variable, on DOS/WINDOWS either TMP or TEMP.

 

SYSTEM SPECIFIC NOTES

 

DOS/WINDOWS

pstoedit compiled with MS-Visual C++ or Borland C++ runs under 32-bit only. It might run under WIN32s, but certainly does not run under plain 16-bit DOS.

The WMF driver backend is available only if pstoedit was compiled using Borland C++. A graphical user interface for pstoedit is available under winp2eex. The compilation of the GUI is only possible under Borland C++. The GUI relies on pstoedit to be installed correctly somewhere in a directory where your PATH variable points to, since it calls pstoedit as a subprocess. When the GUI is run, it creates a file named makeedit.err which contains error and trace messages from the GUI.  

OS/2

When running pstoedit on OS/2 you need to call it using the script ps2edit.cmd.

 

TROUBLE SHOOTING

If you have problems with pstoedit first try whether Ghostscript successfully displays your file. If yes try pstoedit -f ps infile.ps testfile.ps and check whether testfile.ps still displays correctly using Ghostscript. If this file doesn't look correctly then there seems to be a problem with pstoedit's PostScript frontend. If this file looks good but the output for a specific format is wrong, the problem is probably in the backend for the specific format. In either case send bug fixes and reports to the author.  

RESTRICTIONS

Non-standard fonts (e.g. TeX bitmap fonts) are mapped to a default font which can be changed using the -df option. pstoedit chooses the size of the replacement font such that the width of the string in the original font is the same as in the replacement font. This is done for each text fragment displayed. Special character encoding support is limited in this case. If a character cannot be mapped into the target format, pstoedit displays a '#' instead.

pstoedit does not support bitmap graphics, which are left as an exercise for the user. (Ghostscript can be used to generate bitmap output; there are a number of useful filters that convert various vector graphic formats into bitmaps.)

The Gnuplot backend and the 3D backends (rpl, lwo, rib) do not support text.

The OS/2 met backend sometimes causes the viewer to fail, although drawing directly to screen works. This problem is solved with OS/2 FixPak 22.

pstoedit does not yet generate placeable metafiles. This feature is planned for a future release.

Special note about the Java backend

The java backend generates a java source file that needs other files in order to be compiled and usable. These files are not part of pstoedit but can be obtained from the author.

These other files are Java classes (one applet and support classes) that allow to step through the individual pages of a converted PostScript document. This applet can easily be activated from a html-document.

 

NOTICES

 

AUTHOR

Wolfgang Glunz, Wolfgang.Glunz@mchp.siemens.de

 

CANONICAL ARCHIVE SITE

ftp://ftp.x.org/contrib/applications/pstoedit/pstoedit.html

 

ACKNOWLEDGEMENTS

*
Klaus Steinberger <Klaus.Steinberger@physik.uni-muenchen.de> wrote the initial version of this manpage.
*
Lar Kaufman <lark@walden.com> revised the increasingly complex command syntax diagrams and updated the structure and content of this manpage following release 2.5. <URL:http://www.walden.com/~lark/>
*
David B. Rosen <rosen@unr.edu> provided ideas and some PostScript code from his ps2aplot program.
*
Ian MacPhedran <Ian_MacPhedran@engr.USask.CA> provided the xfig backend.
*
Carsten Hammer <chammer@hermes.hrz.uni-bielefeld.de> provided the gnuplot backend and the initial DXF backend.
*
Christoph Jaeschke <jaeschke@imbe05.imbe.uni-bremen.de> provided the OS/2 metafile (MET) backend.
*
Jens Weber <rz47b7@PostAG.DE> provided the Windows metafile (WMF) backend, and a graphical user interface (GUI).
*
G. Edward Johnson <lorax@nist.gov> provided the CGM Draw library used in the CGM backend. <URL:http://speckle.ncsl.nist.gov/~lorax/>
*
Gerhard Kircher <kircher@edvz.tuwien.ac.at> provided some bug fixes.
*
Bill Cheng <william@cs.columbia.edu> provided help with the tgif format and some changes to tgif to make the backend easier to implement.
<URL:http://www.cs.columbia.edu/~william>
*
Reini Urban <rurban@sbox.tu-graz.ac.at> provided input for the extended DXF backend.
<URL:http://xarch.tu-graz.ac.at/autocad/>
*
Glenn M. Lewis <glewis@c2.net> provided RenderMan (RIB), Real3D (RPL), and LightWave 3D (LWO) backends. <URL:http://www.c2.net/~glewis/>
*
Piet van Oostrum <piet@cs.ruu.nl> made several bug fixes.
*
Lutz Vieweg <lkv@mania.robin.de> provided several bug fixes and suggestions for improvements.
*
Derek B. Noonburg <derekn@vw.ece.cmu.edu> and
Rainer Dorsch <rd@berlepsch.wohnheim.uni-ulm.de> isolated and resolved a Linux-specific core dump problem.
*
Rob Warner <rcw2@ukc.ac.uk> made pstoedit compile under RiscOS.
*
Patrick Gosling <jpmg@eng.cam.ac.uk> made some suggestions regarding the usage of pstoedit in Ghostscript's SAFER mode.
*
Scott Pakin <pakin@cs.uiuc.edu> for the Idraw backend.

 

LEGAL NOTICES

Trademarks mentioned are the property of their respective owners.

Some code incorporated in the pstoedit package is subject to copyright or other intellectual property rights or restrictions including attribution rights. See the notes in individual files.

pstoedit is controlled under the Free Software Foundation GNU Public License (GPL).

Aladdin Ghostscript is a redistributable software package with copyright restrictions controlled by Aladdin Software.

pstoedit has no other relation to Ghostscript besides calling it in a subprocess.

The authors, contributors, and distributors of pstoedit are not responsible for its use for any purpose, or for the results generated thereby. The CGM cd-library is distributed under the following notice:

[CD] software produced by NIST, an agency of the U.S. government, is by statute not subject to copyright in the United States. Recipients of this software assume all responsibilities associated with its operation, modification, and maintenance.

Restrictions such as the foregoing may apply in other countries according to international conventions and agreements.

 

SEE ALSO

dvips(1), gs(1), ghostview(1), gnuplot(1), tgif(1), Xfig(1) idraw(1),


 

Index

NAME
SYNOPSIS
DESCRIPTION
RELEASE LEVEL
USE
NOTES
OPTIONS
BACK END-SPECIFIC OPTIONS
NOTES
ENVIRONMENT VARIABLES
SYSTEM SPECIFIC NOTES
DOS/WINDOWS
OS/2
TROUBLE SHOOTING
RESTRICTIONS
NOTICES
AUTHOR
CANONICAL ARCHIVE SITE
ACKNOWLEDGEMENTS
LEGAL NOTICES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 16:25:58 GMT, April 15, 1997