Version 3.01
Dr. Wolfgang Glunz
pstoedit - a tool converting PostScript and PDF files into various vector graphic formats
pstoedit [-help]
pstoedit [-df fontname] [-dis] [-dt] [-flat number] [-include includefile] [-merge] [-nomaptoisolatin1] [-nq] [-page number] [-psarg string] [-s factor] [-split] [-v] -f format[:options] [inputfile [outputfile]]
pstoedit [-s factor] -f format[:options] -bo inputfile [outputfile]
From within gsview pstoedit can be called via "Edit | Convert to vector format"
pstoedit can also be used as PostScript and PDF graphic import filter for several programs including MS-Office 95/97, PaintShop-Pro and PhotoLine. See http://www.geocities.com/SiliconValley/Network/1958/importps/ for more details.
This manpage documents release 3.0.0 of pstoedit.
pstoedit converts PostScript and PDF files to various vector graphic formats. The resulting files can be edited or imported into various drawing packages. Type
to get a list of supported output formats. Pstoedit comes with a large set of format drivers integrated in the binary. Additional drivers can be installed as plugins and are available via http://www.geocities.com/SiliconValley/Network/1958/plugins/ Just copy the plugins to the same directory where the pstoedit binary is installed. However, unless you also get a license key for the plugins, the additional drivers will slightly distort the resulting graphics. See the documentation provided with the plugins for further details.
pstoedit works by redefining the two basic painting operators of PostScript, stroke and show (bitmaps drawn by the image operator are currently only supported by the xfig and the MIF backend.) 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 -psarg "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 can use multiple -psarg options -psarg opt1 -psarg opt2 -psarg opt2 See the GhostScript manual 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.
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:
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'.
turns on a verbose mode;
tells pstoedit to generate an enhanced metafile instead of a normal metafile.
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
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.
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 GhostScript manual 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.
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.
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.
In order to use the command line version start a DOS box. Then do: set GS_LIB=?:\gstools\gsx.xx;?:\gstools\gsx.xx\fonts (replace ? and x.xx according to you local environment). If your PATH does not contain the GhostScript directory, you have to add this as well.
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.
When running pstoedit on OS/2 you need to call it using the script ps2edit.cmd.
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.
A common problem with PostScript files is that the PostScript file redefines one of the standard PostScript operators inconsistently. There is no effect of this if you just print the file since the original PostScript "program" uses these new operator in the new meaning and does not use the original ones anymoew. However, when run under the control of pstoedit, these operators are expected to work with the original semantics.
So far I've seen redefinitions for:
I've included work-arounds for the ones mentioned above, but some others could show up in addition to those.
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 supports bitmap graphics only for the xfig and MIF backends.
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.
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.
Wolfgang Glunz, wglunz@geocities.com
http://www.geocities.com/SiliconValley/Network/1958/pstoedit/
At this site you also find more information about pstoedit and related programs and hints how to subscribe to a mailing list in order to get informed about new releases and bug-fixes.
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). However, this does not apply to importps and the additional plugins.
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.
Restrictions such as the foregoing may apply in other countries according to international conventions and agreements.
Januar 10, 1999