pstoedit - Man Page

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

Examples (TL;DR)

Synopsis

From a Command Shell

pstoedit [-v -help]

pstoedit The following options are available:  [-include filename] [-df font name] [-nomaptoisolatin1] [-dis] [-pngimage filename] [-q] [-nq] [-nc] [-mergelines] [-filledrecttostroke] [-mergetext] [-dt] [-adt] [-ndt] [-dgbm] [-correctdefinefont] [-pti] [-pta] [-xscale number] [-yscale number] [-xshift number] [-yshift number] [-centered] [-minlinewidth number] [-pagenumberformat page number format specification] [-split] [-v] [-vl ] [-usebbfrominput] [-ssp] [-sfill] [-uchar character] [-nb] [-rdb] [-page page number] [-flat flatness factor] [-sclip] [-ups] [-rgb] [-useagl] [-noclip] [-t2fontsast1] [-keep] [-debugfonthandling] [-gstest] [-fakedateandversion] [-nfr] [-glyphs] [-useoldnormalization] [-rotate angle (0-360)] [-fontmap name of font map file for pstoedit] [-pagesize page format] [-help] [-bo] [-psarg argument string] [-pslanguagelevel PostScript Language Level 1, 2, or 3 to be used.] -f "format[:options]" [-gs either full path to the Ghostscript executable/DLL or - for Windows - just a version number (e.g. 10.01.0), in which case the version is used to look up the path from the registry.] [-gsregbase Ghostscript base registry path] [ inputfile [outputfile] ]

From Pstoeditqtgui

PstoeditQtGui provides an alternative to the command driven operation.  The GUI provides access to almost all options and features that are supported by pstoedit. In addition it supports the conversion of multiple files in one job and also provides some  shortcuts to some of Ghostscript's high level output devices.

The GUI is implemented using QT (https://www.qt.io).

The various options provided by pstoedit are displayed in different tabs in the GUI according to their category.  A link to a more detailed description of each option into this manual is provided with each option in the GUI.

Side note: None of the options are "hard coded" into the GUI. Instead the meta information is retrieved from pstoedit itself.  By this the GUI is always up to date with respect to the options and formats provided by pstoedit.

Description

Release Level

This man-page documents release 4.01 of pstoedit.

Use

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

pstoedit -help

for a list of supported output formats. Pstoedit comes with a  large set of format drivers built into in the binary. Additional drivers can be  installed as plugins and are available from  http://www.pstoedit.net/plugins/. Simply copy the plugins into the same directory where the pstoedit binary is installed or - on Unix like systems only - alternatively into the lib directory in parallel to the bin directory where pstoedit 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  that comes with the plugins for more details.

Principle of Conversion

pstoedit works by redefining some of PostScript's basic drawing operators,  such as stroke or show (bitmaps drawn by the image  operator are not supported by all output formats.) After  redefining these operators, the PostScript or PDF file that needs to be  converted is processed by a PostScript interpreter, e.g., Ghostscript  (gs(1)). You normally need to have a PostScript interpreter installed in  order to use this program. However, you can perform some "back end only" processing  of files following the conventions of the pstoedit intermediate format by specifying the -bo option. See "Available formats and their specific options" below.

The output that is written by the interpreter due to the redefinition of the  drawing operators is a kind of 'flat' PostScript file containing only simple  operations such as moveto, lineto, show, etc. You can view this file using the  -f debug option.

This output is read by the end-processing functions of pstoedit and triggers  the drawing functions in the selected output format driver sometimes called also "back-end".

Notes on Ghostscript

Although pstoedit was designed to allow the use of any kind of PostScript interpreter, it  has only been tested in combination with Ghostscript (https://ghostscript.com).

Up to version 9.55 of Ghostscript, it's PDF interpreter was implemented in PostScript itself.  That allowed pstoedit to handle PDF files in the same way as PostScript files since the same  mechanisms for intercepting the drawing operations could be used.

However, from version 9.56 on, the PDF interpreter of Ghostscript was implemented in C and  hence the interceptions used by pstoedit are no longer effective when processing PDF files.

You need to convert the PDF to PostScript at first before you can convert it into another format.  You can use Ghostscript for that or also use the gs:ps2write (-f gs:ps2write) driver from pstoedit.

Options

General Options

The following options are available:

[-include filename]

This option allows specifying 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.

[-xscale number]

scale by a factor in x-direction

[-yscale number]

scale by a factor in y-direction

[-xshift number]

shift image in x-direction

[-yshift number]

shift image in y-direction

[-centered]

center image before scaling or shifting

[-minlinewidth number]

minimal line width. All lines thinner than this will be drawn in this line width - especially zero-width lines

[-pagenumberformat page number format specification]

format specification for page numbers in filename if -split is used. The specification is used to create the page number using sprintf. The specification shall not include the leading % nor the trailing d. Default is empty string which results in formatting the page number using %d. This results in page numbers like 1, 2, ..., 10. Sometimes you may want to have fixed length with leading 0, so you might want to specify 02 which means 2 digits with leading 0.

[-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 output formats that do not support multiple pages within one file, e.g. fig or gnuplot.

[-usebbfrominput]

If specified, pstoedit uses the BoundingBox as is (hopefully) found in the input file instead of one that is calculated by its own.

[-page page number]

Select a single page from a multi-page PostScript or PDF file.

[-rgb]

Since version 3.30 pstoedit uses the CMYK colors internally. The -rgb option turns on the old behavior to use RGB values.

[-useagl]

use Adobe Glyph List instead of the ISO Latin-1 table (this is experimental)

[-noclip]

do not use clipping (relevant only if output format supports clipping at all)

[-rotate angle (0-360)]

Rotate image by angle.

[-pagesize page format]

set page size for output medium.  This option sets the page size for the output medium. Currently this is just used by the libplot output format driver, but might be used by other output format drivers in future. The page size is specified in terms of the usual page size names, e.g. letter or a4.

[-help]

show the help information

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

[-psarg argument 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 the -dis option is given.) If you want to pass multiple options to Ghostscript you can use multiple -psarg options -psarg opt1 -psarg opt2 -psarg opt2. See the Ghostscript manual for other possible options.

[-pslanguagelevel PostScript Language Level 1, 2, or 3 to be used.]

PostScript Language Level 1, 2, or 3 to be used. You can switch Ghostscript into PostScript Level 1 only mode by -pslanguagelevel 1. 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. The default language level is 3.

-f "format[:options]"

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 "Available formats and their specific options" below for an explanation of the [:options] to -f format. If the format option is not given, pstoedit tries to guess the target format from the suffix of the output filename. However, in a lot of cases, this is not a unique mapping and hence pstoedit demands the -f option.

[-gs either full path to the Ghostscript executable/DLL or - for Windows - just a version number (e.g. 10.01.0), in which case the version is used to look up the path from the registry.]

tells pstoedit which Ghostscript executable/DLL to use - overwrites the internal search heuristic

[-gsregbase Ghostscript base registry path]

registry path to use as a base path when searching Ghostscript interpreter.  This option provides means to specify a registry key under HKLM/Software where to search for GS interpreter key, version and GS_DLL / GS_LIB values. Example: "-gsregbase MyCompany" means that HKLM/Software/MyCompany/GPL Ghostscript would be searched instead of HKLM/Software/GPL Ghostscript.

Diagnostic and Debug Options

The following options are available:

[-dis]

Open a display during processing by Ghostscript. Some files only work correctly this way.

[-q]

quiet mode - do not write startup message

[-nq]

no exit from the PostScript interpreter. Normally Ghostscript exits after processing the pstoedit input-file. 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.

[-vl ]

Switch on verbose mode with a given level. Some additional information is shown during processing.

[-nb]

Since version 3.10 pstoedit uses the -dDELAYBIND option when calling Ghostscript. Previously the -dNOBIND option was used instead but that sometimes caused problems if a user's PostScript file overloaded standard PostScript operator with totally new semantic, e.g. lt for lineto instead of the standard meaning of "less than". Using -nb the old style can be activated again in case the -dDELAYBIND gives different results as before. In such a case please also contact the author.

[-rdb]

Since version 3.10 pstoedit uses the -dDELAYBIND option when calling Ghostscript. But in version 9.22 of Ghostscript, that option is not supported anymore because of security reasons. As a fallback, that version provides the REALLYDELAYBIND option and pstoedit can use this if you supply the -rdb option. Use this with caution as it might open security risks, e.g. a PostScript file injecting some malicious code into PostScript standard operators. However, not using this option can cause some of the PostScript drawings operations to be not seen by pstoedit, hence causing missing artefacts in the output. Later versions of Ghostscript will probably support -dDELAYBIND again. But also in that case the security risk remains. So be careful with what files you process with pstoedit and Ghostscript.

[-ups]

write text as plain string instead of hex string in intermediate format - normally useful for trouble shooting and debugging only.

[-keep]

keep the intermediate files produced by pstoedit - for debug purposes only

[-debugfonthandling]

writes verbose messages related to internal font processing - for debug purposes only

[-gstest]

perform a basic test of the interworking with Ghostscript

[-fakedateandversion]

Just for regression testing - uses a constant date and version string.

Input and Outfile File Arguments

[ inputfile [outputfile] ]

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.  The special filename "-" can also be used. It represents standard input if it is the first on the command line and standard output if it is the second. So "pstoedit - output.xxx" reads from standard input and writes to output.xxx

Available Formats and Their Specific Options

pstoedit allows passing individual options to an output format driver. 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 output format driver, the whole argument to -f must be  enclosed within double-quote characters, thus:

-f "format[:option option ...]"
To see which options are supported by a specific format, type:  pstoedit -f format:-help

The following description of the different formats supported by pstoedit is extracted from the source code of the individual drivers.

Format Group: PSF PS Debug Dump Ps2ai GS

This group consists of the following variants:

psf:

Flattened PostScript (no curves).

ps:

Simplified PostScript with curves.

debug:

for test purposes.

dump:

for test purposes (same as debug).

ps2ai:

Adobe Illustrator via ps2ai.ps of Ghostscript.

gs:

any device that Ghostscript provides - use gs:format, e.g. gs:pdfwrite.

No format specific options

Format Group: Gmfa GMFB Plot Plot-Cgm Plot-Ai Plot-Svg Plot-Ps Plot-Fig Plot-Pcl Plot-Hpgl Plot-Tek

This group consists of the following variants:

gmfa:

ASCII GNU metafile.

gmfb:

binary GNU metafile.

plot:

GNU libplot output types, e.g. plot:-plotformat X.

plot-cgm:

cgm via GNU libplot.

plot-ai:

ai via GNU libplot.

plot-svg:

svg via GNU libplot.

plot-ps:

ps via GNU libplot.

plot-fig:

fig via GNU libplot.

plot-pcl:

pcl via GNU libplot.

plot-hpgl:

hpgl via GNU libplot.

plot-tek:

tek via GNU libplot.

The following driver specific options are available in this group:

[-plotformat string]

plotutil format to generate

Magick - Magick Driver Compatible with Version 7.0.7 of Imagemagick.

This driver uses the C++ API of ImageMagick or GraphicsMagick to finally produce different output formats. The output format is determined automatically by Image-/GraphicsMagick based on the suffix of the output filename. So an output file test.png will force the creation of an image in PNG format. This binary of pstoedit was compiled against version 7.0.7 of ImageMagick.

No format specific options

SWF - SWF Driver

The following driver specific options are available:

[-cubic]

cubic ???

[-trace]

trace ???

Format Group: SVG Xaml

This group consists of the following variants:

svg:

Scalable Vector Graphics.

xaml:

eXtensible Application Markup Language.

The following driver specific options are available in this group:

[-localdtd]

use local DTD

[-standalone]

create stand-alone type svg

[-withdtd]

write DTD

[-withgrouping]

write also ordinary save/restores as SVG group

[-nogroupedpath]

do not write a group around paths

[-noviewbox]

do not write a view box

[-texmode]

TeX mode

[-imagetofile]

write raster images to separate files instead of embedding them

[-notextrendering]

do not write textrendering attribute

[-border number]

additional border to draw around bare bounding box (in percent of width and height)

[-title string]

text to use as title for the generated document

Format Group: CGMB1 CGMB CGMT

This group consists of the following variants:

cgmb1:

CGM Binary format (V1).

cgmb:

CGM Binary format (V3).

cgmt:

CGM Textual format.

No format specific options

Mif - (Frame)Maker Intermediate Format

The following driver specific options are available:

[-nopage]

do not add a separate Page entry

RTF - Rich Text Format

No format specific options

Format Group: Wemf Wemfc Wemfnss

This group consists of the following variants:

wemf:

Wogl's version of EMF.

wemfc:

Wogl's version of EMF with experimental clip support.

wemfnss:

Wogl's version of EMF - no subpaths.

The following driver specific options are available in this group:

[-df]

write info about font processing

[-dumpfontmap]

write info about font mapping

[-size:psbbox]

use the bounding box as calculated by the PostScript frontend as size

[-size:fullpage]

set the size to that of the full page

[-size:automatic]

let MS Windows calculate the bounding box (default)

[-keepimages]

debug option - keep the embedded bitmaps as external files

[-useoldpolydraw]

do not use MS Windows' PolyDraw but an emulation of it - sometimes needed for certain programs reading the EMF files

[-donotusepolydraw]

use lineto and moveto instead of polydraw when drawing a path

[-OO]

generate OpenOffice compatible EMF file

Format Group: HPGL PCL

This group consists of the following variants:

hpgl:

HPGL code.

pcl:

PCL code.

The following driver specific options are available in this group:

[-penplotter]

plotter is pen plotter (i.e. no support for specific line widths)

[-pencolorsfromfile]

read pen colors from file drvhpgl.pencolors in pstoedit's data directory

[-pencolors number]

maximum number of pen colors to be used by pstoedit (default 0) -

[-filltype string]

select fill type e.g. FT 1

[-hpgl2]

Use HPGL/2 instead of HPGL/1

[-rot90]

rotate hpgl by 90 degrees

[-rot180]

rotate hpgl by 180 degrees

[-rot270]

rotate hpgl by 270 degrees

Pcb-Rnd - Pcb-Rnd Format

See also: http://repo.hu/projects/pcb-rnd and http://www.penguin.cz/~utx/pstoedit-pcb/

The following driver specific options are available:

[-grid double number]

attempt to snap relevant output to grid (mils) and put failed objects to a different layer

[-snapdist double number]

grid snap distance ratio (0 < snapdist <= 0.5, default 0.1)

[-tshiftx double number]

additional x shift measured in target units (mils)

[-tshifty double number]

additional y shift measured in target units (mils)

[-mm]

switch to metric units (mm)

[-forcepoly]

force all objects to be interpreted as polygons

Pic - Pic Format for Troff et.al.

The following driver specific options are available:

[-troff]

troff mode (default is groff)

[-landscape]

landscape output

[-portrait]

portrait output

[-keepfont]

print unrecognized literally

[-text]

try not to make pictures from running text

[-debug]

enable debug output

Asy - Asymptote Format

No format specific options

Cairo - Cairo Driver

generates compilable c code for rendering with cairo

The following driver specific options are available:

[-pango]

use pango for font rendering

[-funcname string]

sets the base name for the generated functions and variables. e.g. myfig

[-header string]

sets the output file name for the generated C header file. e.g. myfig.h

CFDG - Context Free Design Grammar

Context Free Design Grammar, usable by Context Free Art (http://www.contextfreeart.org/)

No format specific options

Format Group: DXF Dxf_14 Dxf_s

This group consists of the following variants:

dxf:

CAD exchange format version 9 - only limited features. Consider using dxf_14 instead..

dxf_14:

CAD exchange format version 14 supporting splines and linetypes.

dxf_s:

CAD exchange format version 14 supporting splines and linetypes.

The following driver specific options are available in this group:

[-polyaslines]

use LINE instead of POLYLINE in DXF

[-mm]

use mm coordinates instead of points in DXF (mm=pt/72*25.4)

[-ctl]

map colors to layers

[-filltohatch]

generate hatch objects from fill operations (still experimental)

[-splineaspolyline]

approximate splines with PolyLines (only for -f dxf_s)

[-splineasnurb]

experimental (only for -f dxf_s)

[-splineasbspline]

experimental (only for -f dxf_s)

[-splineassinglespline]

experimental (only for -f dxf_s)

[-splineasmultispline]

experimental (only for -f dxf_s)

[-splineasbezier]

use Bezier splines in DXF format (only for -f dxf_s)

[-splineprecision number]

number of samples to take from spline curve when doing approximation with -splineaspolyline or -splineasmultispline - should be >= 2 (default 5)

[-dumplayernames]

dump all layer names found to standard output

[-layers string]

layers to be shown (comma separated list of layer names, no space)

[-layerfilter string]

layers to be hidden (comma separated list of layer names, no space)

Format Group: Fig Xfig Tfig

This group consists of the following variants:

fig:

.fig format for xfig.

xfig:

.fig format for xfig.

tfig:

.fig format for xfig - test only version.

The xfig format driver supports special fontnames, which may be produced by using a fontmap file. The following types of names are supported:

General notation:
"PostScript Font Name" ((LaTeX|PostScript|empty)(::special)::)XFigFontName

Examples:

Helvetica LaTeX::SansSerif
Courier LaTeX::special::Typewriter
GillSans "AvantGarde Demi"
Albertus PostScript::special::"New Century Schoolbook Italic"
Symbol ::special::Symbol (same as PostScript::special::Symbol)

See also the file examplefigmap.fmp in the misc directory of the pstoedit source distribution for an example font map file for xfig. Please note that the fontname has to be among those supported by xfig. See - https://mcj.sourceforge.net/fig-format.html for a list of legal font names

The following driver specific options are available in this group:

[-startdepth number]

set the initial depth (default 999)

[-metric]

switch to centimeter display (default inches)

[-usecorrectfontsize]

do not scale fonts for xfig. Use this if you also use this option with xfig

[-depth number]

set the page depth in inches (default 11)

Gcode - Emc2 Gcode Format

See also: http://linuxcnc.org/

No format specific options

Gnuplot - Gnuplot Format

No format specific options

Gschem - Gschem Format

See also: http://wiki.geda-project.org/geda:gaf

No format specific options

Idraw - Interviews Draw Format (Eps)

No format specific options

Java1 - Java 1.pplet Source Code

The following driver specific options are available:

[java_class_name string]

name of java class to generate

Java2 - Java 2 Source Code

The following driver specific options are available:

[java_class_name string]

name of java class to generate

Kil - .kil Format for Kontour

No format specific options

LATEX2E - LaTeX2E PICTURE FORMAT

The following driver specific options are available:

[-integers]

round all coordinates to the nearest integer

Lwo - Lightwave 3D Object Format

No format specific options

Mma - Mathematica Graphics

The following driver specific options are available:

[-eofillfills]

Filling is used for eofill (default is not to fill)

Mpost - Metapost Format

No format specific options

Noixml - Nemetschek Noi XML Format

Nemetschek Object Interface XML format

The following driver specific options are available:

[-r string]

Allplan resource file

[-bsl number]

Bezier Split Level (default 3)

Pcbi - Engrave Data - Insulate/Pcb Format

No format specific options

PCB - PCB Format

See also: http://pcb.sourceforge.net and http://www.penguin.cz/~utx/pstoedit-pcb/

The following driver specific options are available:

[-grid double number]

attempt to snap relevant output to grid (mils) and put failed objects to a different layer

[-snapdist double number]

grid snap distance ratio (0 < snapdist <= 0.5, default 0.1)

[-tshiftx double number]

additional x shift measured in target units (mils)

[-tshifty double number]

additional y shift measured in target units (mils)

[-mm]

switch to metric units (mm)

[-stdnames]

use standard layer names instead of descriptive names

[-forcepoly]

force all objects to be interpreted as polygons

Pcbfill - PCB Format with Fills

See also: http://pcb.sourceforge.net

No format specific options

PDF - Adobe's Portable Document Format

No format specific options

PPTX - Presentationml (Powerpoint) Format

This is the format used internally by Microsoft PowerPoint. LibreOffice can also read/write PowerPoint files albeit with some lack of functionality.

The following driver specific options are available:

[-colors string]

"original" to retain original colors (default), "theme" to convert randomly to theme colors, or "theme-lum" also to vary luminance

[-fonts string]

use "windows" fonts (default), "native" fonts, or convert to the "theme" font

[-embed string]

embed fonts, specified as a comma-separated list of EOT-format font files

Rib - Renderman Interface Bytestream

No format specific options

RPL - Real3d Programming Language Format

No format specific options

Sample - Sample Driver: if You Do Not Want to See This, Uncomment the Corresponding Line in Makefile and Make Again

This is a long description for the sample driver

The following driver specific options are available:

[-sampleoption integer]

just an example

SK - Sketch Format

No format specific options

SVM - starview/openoffice.org Metafile

StarView/OpenOffice.org metafile, readable from OpenOffice.org 1.0/StarOffice 6.0 and above.

The following driver specific options are available:

[-m]

map to Arial

[-nf]

emulate narrow fonts

Text - Text in Different Forms

The following driver specific options are available:

[-height number]

page height in terms of characters

[-width number]

page width in terms of characters

[-dump]

dump text pieces

Tgif - Tgif .obj Format

The following driver specific options are available:

[-ta]

text as attribute

TK - TK and/or tk.pplet Source Code

The following driver specific options are available:

[-R]

swap HW

[-I]

no impress

[-n string]

tagnames

VTK - VTK Driver: if You Do Not Want to See This, Uncomment the Corresponding Line in Makefile and Make Again

this is a long description for the VTKe driver

The following driver specific options are available:

[-VTKeoption integer]

just an example

Format Group: WMF Emf

This group consists of the following variants:

wmf:

MS Windows Metafile.

emf:

Enhanced MS Windows Metafile.

The following driver specific options are available in this group:

[-m]

map to Arial

[-nf]

emulate narrow fonts

[-drawbb]

draw bounding box

[-p]

prune line ends

[-nfw]

Newer versions of MS Windows (2000, XP, Vista, 7, ...) will not accept WMF/EMF files generated when this option is set and the input contains text. But if this option is not set, then the WMF/EMF driver will estimate interletter spacing of text using a very coarse heuristic. This may result in ugly looking output. On the other hand, OpenOffice can still read EMF/WMF files where pstoedit delegates the calculation of the inter letter spacing to the program reading the WMF/EMF file. So if the generated WMF/EMF file shall never be processed under MS Windows, use this option. If WMF/EMF files with high precision text need to be generated under *nix the only option is to use the -pta option of pstoedit. However that causes every text to be split into single characters which makes the text hard to edit afterwards. Hence the -nfw option provides a sort of compromise between portability and nice to edit but still nice looking text. Again - this option has no meaning when pstoedit is executed under MS Windows anyway. In that case the output is portable but nevertheless not split and still looks fine.

[-winbb]

let the MS Windows API calculate the Bounding Box (MS Windows only)

[-OO]

generate OpenOffice compatible EMF file

Notes on Specific Formats and Drivers

Autotrace

pstoedit cooperates with autotrace. Autotrace can now produce a dump file  for further processing by pstoedit using the -bo (back-end only) option.  Autotrace is a program written by a group around Martin Weber and can be  found at https://sourceforge.net/projects/autotrace/.

Ps2ai

The ps2ai output format driver is not a native pstoedit output format driver. It does not use the  pstoedit PostScript flattener, instead it uses the PostScript program  ps2ai.ps which is installed in the Ghostscript distribution directory. It  is included to provide the same "look-and-feel" for the conversion to AI.  However, lot's of files do not  convert nicely or at all using ps2ai.ps. So a native pstoedit driver would  be much better. Anyone out there to take this? The AI format is usable for  example by Mayura Draw (http://www.mayura.com). Also a driver to the  Mayura native format would be nice.

An alternative to the ps2ai based driver is available via the -f plot:ai format if the libplot(ter) is installed.

You should use a version of Ghostscript greater than or equal to 6.00 for using the ps2ai output format driver.

Metapost

Note that, as far as Scott knows, MetaPost does not support PostScript's  eofill. The MetaPost output format driver just converts eofill to fill, and issues a warning if  verbose is set. Fortunately, very few PostScript programs rely on the  even-odd fill rule, even though many specify it.

For more on MetaPost see:

http://tug.org/metapost

Context Free - CFDG

The driver for the CFDG format (drvcfdg) defines  one shape per page of PostScript, but only the first shape is actually  rendered (unless the user edits the generated CFDG code, of course).  CFDG does not support multi-page output, so this probably is a reasonable thing to do.

For more on Context Free see: http://www.contextfreeart.org/

LaTeX2E

  • LaTeX2e's picture environment is not very powerful. As a result, many  elementary PostScript constructs are ignored -- fills, line  thicknesses (besides "thick" and "thin"), and dash patterns, to name a  few. Furthermore, complex pictures may overrun TeX's memory capacity.  (The eepic package overcomes many such restrictions.)
  • Some PostScript constructs are not supported directly by "picture",  but can be handled by external packages. If a figure uses color, the  top-level document will need to do a "\usepackage{color}" or "\usepackage{xcolor}". And if a  figure contains rotated text, the top-level document will need to do a  "\usepackage{rotating}".
  • All lengths, coordinates, and font sizes output by the output format driver are in  terms of \unitlength, so scaling a figure is simply a matter of doing  a "\setlength{\unitlength}{...}".
  • The output format driver currently supports one output format driver specific option,  "integers", which rounds all lengths, coordinates, and font sizes to  the nearest integer. This makes hand-editing the picture a little  nicer.
  • Why is this output format driver useful?  One answer is portability; any LaTeX2e system can handle the picture environment,  even if it cannot handle  PostScript graphics. (pdfLaTeX comes to mind here.) A second answer  is that pictures can be edited easily to contain any arbitrary  LaTeX2e code. For instance, the text in a figure can be modified to contain  complex mathematics, non-Latin alphabets, bibliographic citations, or  -- the real reason Scott wrote the LaTeX2e output format driver -- hyperlinks to the  surrounding document (with help from the hyperref package).

Creating a New Output Format Driver

To implement a new output format driver 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 output format driver.

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

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) man-page  for descriptions of environment variables used. On UNIX like system this is  probably the TMPDIR variable, on DOS/WINDOWS either TMP or  TEMP.

Trouble Shooting

If you have problems with pstoedit first try whether Ghostscript  successfully displays your file. If yes, then try  pstoedit -f ps infile.ps testfile.ps and check whether testfile.ps still displays correctly using  Ghostscript. If this file does not look correctly then there seems to be a  problem with pstoedit's PostScript front-end. If this file looks good  but the output for a specific format is wrong, the problem is probably in  the output format driver 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 operators in the new meaning and does not use the original  ones anymore. 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

Faqs

1.

Why do letters like O or B get strange if converted to TGIF/XFIG  using the -dt option?

Most output format drivers do not support composite paths with  intermediate gaps (moveto's) and second do not support very well the (eo)fill  operators of PostScript (winding rule). For such objects pstoedit breaks  them into smaller objects whenever such a gap is found. This results in the  "hole" being filled with black color instead of being transparent. Since  version 3.11 you can try the -ssp option in combination with the XFIG  output format driver.

2.

Why does pstoedit produce ugly results from PostScript files generated by dvips?

This is because TeX documents usually use bitmap fonts. Such fonts cannot be used as native  font in other format. So pstoedit replaces the TeX font with another native  font. Of course, the replacement font will in most cases produce another  look, especially if mathematical symbols are used.  Try to use PostScript fonts instead of the bitmap fonts when generating a PostScript file from TeX or LaTeX.

Author

Wolfgang Glunz, wglunz35_AT_pstoedit.net, https://de.linkedin.com/in/wolfgangglunz

Canonical Archive Site

http://www.pstoedit.net/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.

If you like pstoedit - please express so also at Facebook https://www.facebook.com/pstoedit.

Acknowledgments

Referenced By

autotrace(1), purifyeps(1).

28 March 2024 Conversion Tools