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]
pstoedit converts PostScript and PDF files to a simple vector graphic format that can be edited or imported into various drawing packages. Type
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.
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.
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.
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.
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'.
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
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:
The met backend allows the following single character options (without a leading -)
Example:
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:
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.
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.
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.
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.
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:
Restrictions such as the foregoing may apply in other countries according to international conventions and agreements.
dvips(1), gs(1), ghostview(1), gnuplot(1), tgif(1), Xfig(1) idraw(1),