PSTOEDIT

Version 3.01

Dr. Wolfgang Glunz

wglunz@geocities.com

NAME
SYNOPSIS
From the command shell
From Gsview
From programs that support the ALDUS graphic import filter interface
DESCRIPTION
RELEASE LEVEL
USE
PRINCIPLE OF CONVERSION
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

 

NAME

pstoedit - a tool converting PostScript and PDF files into various vector graphic formats  

SYNOPSIS

From the command shell

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 Gsview

From within gsview pstoedit can be called via "Edit | Convert to vector format"

From programs that support the ALDUS graphic import filter interface

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.

 

DESCRIPTION

 

RELEASE LEVEL

This manpage documents release 3.0.0 of pstoedit.  

USE

pstoedit converts PostScript and PDF files to various vector graphic formats. The resulting files can be edited or imported into various drawing packages. Type

pstoedit -help

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.

 

PRINCIPLE OF CONVERSION

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.

 

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. This option is automatically switched on if the selected backend does not support this, e.g. gnuplot.
-dis
Open a display during processing by Ghostscript. Some files only work correctly this way.
-psarg 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: -psarg "-r300x300" This causes the resolution to be changed to 300x300 dpi. (With older versions of GhostScript, changing the resolution this way has an effect only if -display is set.)

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.

-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.
-page page number
Select a single page from a multi page PostScript or PDF file.
-split
Create a new file for each page of the input. For this the output filename must contain a %d which is replaced with the current page number. This option is automatically switched on for backends that don't support multiple pages within one file, e.g. fig or gnuplot.
-df fontname
Sometimes fonts embedded in a PostScript programs do not have a fontname. For example, this 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.
Since other format drivers can be loaded dynamically, type pstoedit -help to get a full list of formats. See "BACK END-SPECIFIC OPTIONS" below for an explanation of the [:options] to -f format.
-s factor
scale by the specified factor. (Used 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.
-v
switch on verbose mode. Some additional information is shown during processing.
-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.

 

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 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.

 

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.

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.  

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.

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.

 

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  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.

 

NOTICES

 

AUTHOR

Wolfgang Glunz, wglunz@geocities.com

 

CANONICAL ARCHIVE SITE

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.

 

ACKNOWLEDGEMENTS

 

 

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). 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