PSTOEDIT(1)
๐ฆ pstoedit(1) โ Conversion Tools ๐ฆ
โจ NAME โจ
pstoedit โ a tool converting PostScript files into various vector graphic formats. Bestie, it's the PostScript-to-vector pipeline, and it's iconic. ๐
๐ธ 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] [-usefinddevice] [-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 is the whole alternative to the command-driven operation. It gives you access to almost all options and features that pstoedit supports. Plus it supports converting multiple files in one job, and it also has some shortcuts to some of Ghostscript's high level output devices. Multitasking queen behavior. ๐
The GUI is implemented using QT (https://www.qt.io).
The various options provided by pstoedit show up in different tabs in the GUI according to their category. Each option in the GUI has a link to a more detailed description of that option in this manual.
Side note: None of the options are "hard coded" into the GUI. Instead the meta information is retrieved frompstoedititself. By this the GUI is always up to date with respect to the options and formats provided bypstoedit. No stale menu energy, we love to see it. โจ
๐ฆ DESCRIPTION ๐ฆ
โญ RELEASE LEVEL โญ
This man-page documents release 4.3 of pstoedit.
๐ USE ๐
pstoedit converts PostScript 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. Like, a whole closet of format drivers, no cap. ๐
๐ฅ PRINCIPLE OF CONVERSION ๐ฅ
pstoedit works by redefining some of PostScript's basic drawing operators, such as stroke or show โ and heads up, bitmaps drawn by the image operator are not supported by all output formats. After redefining these operators, the PostScript 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". It's giving translator bestie at a group project. ๐ซถ
๐ 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, its 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. This is the plot twist, bestie. ๐ญ
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. PDF first, then the glow-up. โจ
๐ OPTIONS ๐
๐ GENERAL OPTIONS ๐
The following options are available:
-includefilename โ Lets you 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, ordeletefile. Safety first, bestie.-xscalenumber โ scale by a factor in x-direction.-yscalenumber โ scale by a factor in y-direction.-xshiftnumber โ shift image in x-direction.-yshiftnumber โ shift image in y-direction.-centeredโ center image before scaling or shifting.-minlinewidthnumber โ minimal line width. All lines thinner than this will be drawn in this line width โ especially zero-width lines. No invisible little lines sneaking by.-pagenumberformatpage number format specification โ format specification for page numbers in filename if-splitis used. The specification is used to create the page number usingsprintf. The specification shall not include the leading%nor the trailingd. Default is empty string which results in formatting the page number using%d. This results in page numbers like1,2, ...,10. Sometimes you may want to have fixed length with leading0, so you might want to specify02which means 2 digits with leading0.-splitโ Create a new file for each page of the input. For this the output filename must contain a%dwhich 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.figorgnuplot. One page, one file, one vibe.-usebbfrominputโ If specified,pstoedituses the BoundingBox as is (hopefully) found in the input file instead of one that is calculated by its own.-pagepage number โ Select a single page from a multi-page PostScript or PDF file. Main character page only, please.-rgbโ Since version3.30pstoedituses the CMYK colors internally. The-rgboption turns on the old behavior to use RGB values.-useaglโ use Adobe Glyph List instead of the ISO Latin-1 table (this is experimental). Experimental, so proceed with cute caution.-noclipโ do not use clipping (relevant only if output format supports clipping at all).-rotateangle (0-360) โ Rotate image by angle.-pagesizepage format โ set page size for output medium. This option sets the page size for the output medium. Currently this is just used by thelibplotoutput 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.letterora4.-helpโ show the help information. When in doubt, ask for help โ literally.-boโ You can run backend processing only (without the PostScript interpreter frontend) by first runningpstoedit -f dump infile dumpfileand then runningpstoedit -f format -bo dumpfile outfile. Backend-only era.-psargargument string โ The string given with this option is passed directly to Ghostscript when Ghostscript is called to process the PostScript file forpstoedit. For example:-psarg "-r300x300". This causes the resolution to be changed to300x300dpi. (With older versions of Ghostscript, changing the resolution this way has an effect only if the-disoption is given.) If you want to pass multiple options to Ghostscript you can use multiple-psargoptions-psarg opt1 -psarg opt2 -psarg opt2. See the Ghostscript manual for other possible options. Ghostscript gets the aux cord. ๐ง-pslanguagelevelPostScript 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 bypstoedit. However, this requires that the PostScript program checks for the PostScript level supported by the interpreter and "acts" accordingly. The default language level is3. Level 3 is the default, bestie.-f "format[:options]"โ target output format recognized bypstoedit. Since other format drivers can be loaded dynamically, typepstoedit -helpto get a full list of formats. See "Available formats and their specific options" below for an explanation of the[:options]to-fformat. If the format option is not given,pstoedittries 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 hencepstoeditdemands the-foption. Sometimes you gotta spell out the format, no hinting.-gseither 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. โ tellspstoeditwhich Ghostscript executable/DLL to use โ overwrites the internal search heuristic.-gsregbaseGhostscript base registry path โ registry path to use as a base path when searching Ghostscript interpreter. This option provides means to specify a registry key underHKLM/Softwarewhere to search for GS interpreter key, version andGS_DLL/GS_LIBvalues. Example:"-gsregbase MyCompany"means thatHKLM/Software/MyCompany/GPL Ghostscriptwould be searched instead ofHKLM/Software/GPL Ghostscript. Registry detective work, but make it cute.
๐ TEXT AND FONT HANDLING RELATED OPTIONS ๐
The following options are available:
-dffont name โ Sometimes fonts embedded in a PostScript program do not have a fontname. For example, this happens in PostScript files generated bydvips(1). In such a casepstoedituses a replacement font. The default for this isCourier. Another font can be specified using the-dfoption.-df Helveticacauses all unnamed fonts to be replaced by Helvetica. Unnamed fonts get a makeover. ๐-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. Bestie, this may result in strange text output ๐ญ but on the other hand may be the only way to get some fonts converted appropriately. Try what fits best to your concrete case, fr fr.
-pngimagefilename โ mainly for debugging purpose. Write the result of processing also to a PNG file โจ-dtโ draw text. Text is drawn as polygons, which might produce a large output file ๐ This option is automatically switched on if the selected output format does not support text, e.g.gnuplot(1).-adtโ automatic draw text. This option turns on the-dtoption selectively for fonts that seem to be no normal text fonts, e.g.Symbol.-ndtโ never draw text. Fully disable the heuristics used by pstoedit to decide when to โdrawโ text instead of showing it as text. This may produce incorrect results, but in some cases it might nevertheless be useful. โUse at own riskโ ๐-dgbmโ experimental: draw also bitmaps generated by fonts/glyphs ๐ง-correctdefinefontโ Some PostScript files, e.g. such as generated byChemDraw, use the PostScriptdefinefontoperator in a way that is incompatible with pstoeditโs assumptions. The new font is defined by copying an old font without changing theFontNameof the new font. When this option is applied, some โpatchesโ are done after adefinefontin order to make it again compatible with pstoeditโs assumptions. This option is not enabled by default, since it may break other PostScript files. It is tested only withChemDrawgenerated files ๐-ptiโ precision text. Normally a text string is drawn as it occurs in the input file. However, in some situations, this might produce wrongly positioned characters. This is due to limitations in most output formats of pstoedit. They cannot represent text with arbitrary inter-letter spacing which is easily possible in PDF and PostScript. With-pta, each character of a text string is placed separately. With-pti, this is done only in cases when there is a non zero inter-letter spacing. The downside of โprecision textโ is a bigger file size and hard to edit text ๐ญ-ptaโ see-pti. Yep, same energy ๐-ucharcharacter โ Sometimes pstoedit cannot map a character from the encoding used by the PostScript file to the font encoding of the target format. In this case pstoedit replaces the input character by a special character in order to show all the places that could not be mapped correctly. The default for this is a"#". Using the-ucharoption it is possible to specify another character to be used instead. If you want to use a space, use-uchar " "๐ซถ-t2fontsast1โ Handle Type 2 fonts same as Type 1. Type 2 fonts sometimes occur as embedded fonts within PDF files. In the default mode, text using such fonts is drawn as polygons since pstoedit assumes that such a font is not available on the userโs machine. If this option is set, pstoedit assumes that the internal encoding follows the same as for a standard font and generates normal text output. This assumption may not be true in all cases. But it is nearly impossible for pstoedit to verify this assumption โ it would have to do a sort of OCR ๐-nfrโ In normal mode pstoedit replaces bitmap fonts with a font as defined by the-dfoption. This is done because most output formats cannot handle such fonts. This behavior can be switched off using the-nfroption, but then it strongly depends on the application reading the generated file whether the file is usable and correctly interpreted or not. Any problems are then out of control of pstoedit. ๐-glyphsโ pass glyph names to the output format driver. So far no output format driver really uses the glyph names, so this does not have any effect at the moment. It is a preparation for future work โจ-useoldnormalizationโ Just use this option in case the new heuristic introduced in3.5does not produce correct results โ however, this normalization of font encoding will always be a best-effort approach since there is no real general solution to it with reasonable effort ๐-fontmapname of font map file for pstoedit โ The font map is a simple text file containing lines in the following format:document_font_name target_font_name. Lines beginning with%are considered comments. For font names with spaces use the"font name with spaces"notation.
If a target_font_name starts with /, it is regarded as alias to a former entry.
Each font name found in the document is checked against this mapping and if there is a corresponding entry, the new name is used for the output.
If the -fontmap option is not specified, pstoedit automatically looks for the file drivername.fmp in the installation directory and uses that file as a default fontmap file if available. The installation directory is:
- MS Windows: The same directory where the pstoedit executable is located
- Unix: The default installation directory. If it fails, then
<The directory where the pstoedit executable is located> /../lib/
The mpost.fmp in the misc directory of the pstoedit distribution is a sample map file with mappings from over 5000 PostScript font names to their TeX equivalents. This is useful because MetaPost is frequently used with TeX/LaTeX and those programs do not use standard font names. This file and the MetaPost output format driver are provided by Scott Pakin (scott+ps2ed_AT_pakin.org). Another example is wemf.fmp to be used under Windows. See the misc directory of the pstoedit source distribution. After loading the implicit (based on driver name) or explicit (based on the -fontmap option) font map file, a system specific map file is searched and loaded from the installation directory (unix.fmp or windows.fmp). This file can be used to redirect certain fonts to system specific names using the /AliasName notation described above ๐
๐จ DRAWING RELATED OPTIONS ๐จ
The following options are available, bestie:
-ncโ no curves. Normally pstoedit tries to keep curves from the input and transfers them to the output if the output format supports curves. If the output format does not support curves, then pstoedit replaces curves by a series of lines (see also-flatoption). However, in some cases the user might wish to have this behavior also for output formats that originally support curves. This can be forced via the-ncoption ๐-mergelinesโ 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 by the standard drawing primitives directly, 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-mergelines. However, this merging is not supported by all output formats due to restrictions in the target format ๐-filledrecttostrokeโ Rectangles filled with a solid color can be converted to a stroked line with a width that corresponds to the width of the rectangle. This is of primary interest for output formats which do not support filled polygons at all. But it is restricted to rectangles only, i.e. it is not supported for general polygons โจ-mergetextโ In order to produce nice looking text output, programs producing PostScript files often split words into smaller pieces which are then placed individually on adjacent positions. However, such split text is hard to edit later on and hence it is sometime better to recombine these pieces again to form a word (or even sequence of words). For this pstoedit implements some heuristics about what text pieces are to be considered parts of a split word. This is based on the geometrical proximity of the different parts and seems to work quite well so far. But there are certainly cases where this simple heuristic fails. So please check the results carefully ๐-sspโ simulate subpaths. Several output formats do not support PostScript paths containing subpaths, i.e. paths with intermediate movetos. In the normal case, each subpath is treated as an independent path for such output formats. This can lead to bad looking results. The most common case where this happens is if you use the-dtoption and show some text with letters likee,o, orb, i.e. letters that have a โholeโ. When the-sspoption is set, pstoedit tries to eliminate these problems. However, this option is CPU time intensive! ๐ฅ-sfillโ simulate filling by individual strokes ๐๏ธ-flatflatness factor โ If the output format does not support curves in the way PostScript does or if the-ncoption is specified, all curves are approximated by lines. Using the-flatoption one can control this approximation. This parameter is directly converted to a PostScriptsetflatcommand. Higher numbers, e.g.10give rougher, lower numbers, e.g.0.1, give finer approximations ๐ธ-sclipโ simulate clipping. Most output formats of pstoedit do not have native support for clipping. For that pstoedit offers an option to perform the clipping of the graphics directly without passing the clippath to the output driver. However, this results in curves being replaced by a lot of line segments and thus larger output files. So use this option only if your output looks different from the input due to clipping. In addition, this โsimulated clippingโ is not exactly the same as defined in PostScript. There might be lines drawn at double size. Also clipping of text is not supported unless you also use the-dtoption ๐
๐ฉบ DIAGNOSTIC AND DEBUG OPTIONS ๐ฉบ
Okay bestie, these are the diagnostic/debug options โ very โIโm poking at the internalsโ energy. 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 typequitat theGS>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. (Yeah, the original has a little trailing-space gremlin after-vl; still iconic.)-nbโ Since version3.10pstoedit uses the-dDELAYBINDoption when calling Ghostscript. Previously the-dNOBINDoption was used instead but that sometimes caused problems if a userโs PostScript file overloaded standard PostScript operator with totally new semantic, e.g.ltforlinetoinstead of the standard meaning of โless thanโ. Using-nbthe old style can be activated again in case the-dDELAYBINDgives different results as before. In such a case please also contact the author.-rdbโ Since version3.10pstoedit uses the-dDELAYBINDoption when calling Ghostscript. But in version9.22of Ghostscript, that option is not supported anymore because of security reasons. As a fallback, that version provides theREALLYDELAYBINDoption and pstoedit can use this if you supply the-rdboption. 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-dDELAYBINDagain. 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.-usefinddeviceโ use the ghostscript internalfinddeviceoperator during image handling instead of standard operators โ 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 asdebug).ps2ai:โ Adobe Illustrator viaps2ai.psof Ghostscript.gs:โ any device that Ghostscript provides โ usegs:format, e.g.gs:pdfwrite.
No format specific options. Literally none, bestie. ๐
๐ FORMAT GROUP: GMFA GMFB PLOT PLOT-PNM 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-pnm:โ pnm via GNU libplot.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. ๐
๐งช SAMPLE - SAMPLE DRIVER ๐งช
This is a long description for the sample driver.
The following driver specific options are available:
-sampleoption integerโ just an example.
๐จ IDRAW - INTERVIEWS DRAW FORMAT (EPS) ๐จ
No format specific options. Slay. โจ
๐ธ FORMAT GROUP: FIG XFIG TFIG ๐ธ
This group consists of the following variants:
fig:โ.figformat for xfig.xfig:โ.figformat for xfig.tfig:โ.figformat 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 (default999).-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 (default11).
๐ง TGIF - TGIF .OBJ FORMAT ๐ง
The following driver specific options are available:
-taโ text as attribute.
๐ GNUPLOT - GNUPLOT FORMAT ๐
No format specific options. Periodt. ๐
๐ 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.
๐ 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.
๐ฅ VTK - VTK DRIVER ๐ฅ
this is a long description for the VTKe driver.
The following driver specific options are available:
-VTKeoption integerโ just an example.
๐ TK - TK AND/OR TK.PPLET SOURCE CODE ๐
The following driver specific options are available:
-Rโ swap HW.-Iโ no impress.-n stringโ tagnames.
๐ CFDG - CONTEXT FREE DESIGN GRAMMAR ๐
Context Free Design Grammar, usable by Context Free Art (http://www.contextfreeart.org/).
No format specific options. ๐
โญ GSCHEM - GSCHEM FORMAT โญ
See also: http://wiki.geda-project.org/geda:gaf
No format specific options. โจ
๐ 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, default0.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.
๐ซถ PCBFILL - PCB FORMAT WITH FILLS ๐ซถ
See also: http://pcb.sourceforge.net
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, default0.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.
๐ง PCBI - ENGRAVE DATA - INSULATE/PCB FORMAT ๐ง
No format specific options. Thatโs the whole vibe. ๐
๐ง FORMAT GROUP: HPGL PCL
okay so this group is giving plotter energy and it's actually two variants in a trench coat:
hpglโ HPGL code โจpclโ PCL code โจ
and here's the driver-specific option squad for this group:
-penplotterโ your plotter is a pen plotter, meaning no support for specific line widths (so, like, don't come for it about line width, it literally can't)-pencolorsfromfileโ reads pen colors from the filedrvhpgl.pencolorssitting in pstoedit's data directory ๐จ-pencolors numberโ the max number of pen colors pstoedit is allowed to use (default0)-filltype stringโ picks the 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
๐ PIC - PIC FORMAT FOR TROFF ET.AL.
driver specific options, coming right up:
-troffโ troff mode (default is groff, bestie)-landscapeโ landscape output-portraitโ portrait output-keepfontโ print unrecognized literally-textโ try not to make pictures from running text-debugโ enable debug output
๐ฆ NOIXML - NEMETSCHEK NOI XML FORMAT
Nemetschek Object Interface XML format, iconic name honestly.
The driver specific options:
-r stringโ Allplan resource file-bsl numberโ Bezier Split Level (default3)
๐ LATEX2E - LaTeX2E PICTURE FORMAT
-integersโ round all coordinates to the nearest integer
๐ธ MMA - MATHEMATICA GRAPHICS
-eofillfillsโ Filling is used for eofill (default is not to fill)
โญ ASY - ASYMPTOTE FORMAT
No format specific options. That's it. That's the whole section. Slay, minimal queen.
๐ MPOST - METAPOST FORMAT
No format specific options.
๐ SK - SKETCH FORMAT
No format specific options.
๐ TEXT - TEXT IN DIFFERENT FORMS
-height numberโ page height in terms of characters-width numberโ page width in terms of characters-dumpโ dump text pieces
๐ KIL - .KIL FORMAT FOR KONTOUR
No format specific options.
๐ PDF - ADOBE'S PORTABLE DOCUMENT FORMAT
No format specific options.
๐ง JAVA2 - JAVA 2 SOURCE CODE
java_class_name stringโ name of java class to generate
๐ฅ JAVA1 - JAVA 1.PPLET SOURCE CODE
java_class_name stringโ name of java class to generate
๐ธ FORMAT GROUP: DXF DXF_14 DXF_S
so this group is the CAD-adjacent trio, and each variant has a whole personality:
dxfโ CAD exchange format version 9 - only limited features. Consider usingdxf_14instead.. (yes, two periods, that's how it's written, leave it)dxf_14โ CAD exchange format version 14 supporting splines and linetypes.dxf_sโ CAD exchange format version 14 supporting splines and linetypes.
driver specific options for the group:
-polyaslinesโ useLINEinstead ofPOLYLINEin 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-splineaspolylineor-splineasmultispline- should be =2 (default5)-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)
๐ RPL - REAL3D PROGRAMMING LANGUAGE FORMAT
No format specific options.
โจ RIB - RENDERMAN INTERFACE BYTESTREAM
No format specific options.
๐ฆ LWO - LIGHTWAVE 3D OBJECT FORMAT
No format specific options.
๐ CAIRO - CAIRO DRIVER
generates compilable c code for rendering with cairo โ yes, actual C code, we love a compiler-ready moment.
The driver specific options:
-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
๐ฅ GCODE - EMC2 GCODE FORMAT
See also: http://linuxcnc.org/
No format specific options.
๐ 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
okay so bestie, heads up: 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. no cap, that's the requirement ๐
๐ 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:
๐ธ 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. (yes, go build your own driver, main character energy ๐ซถ)
๐ 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 ๐ ๏ธ
okay bestie, if pstoedit is being a whole mess, here's the diagnostic order, follow it fr fr:
First, check whether Ghostscript itself can successfully display your file. If yes, then try pstoedit -f ps infile.ps testfile.ps and check whether testfile.ps still displays correctly using Ghostscript.
- If
testfile.psdoes not look correct โ there seems to be a problem withpstoedit's PostScript front-end. ๐ญ - If
testfile.pslooks good but the output for a specific format is wrong โ the problem is probably in the output format driver for that specific format.
Either way, send bug fixes and reports to the author. ๐ซถ
A super common PostScript problem: the 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. But when run under the control of pstoedit, these operators are expected to work with the original semantics. ๐
So far the redefinitions spotted are:
ltโ "less-then" to mean "draw a line to"stringโ "create a string object" to mean "draw a string"lengthโ "get the length of e.g. a string" to a "float constant"
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
-dfoption.pstoeditchooses the size of the replacement font such that the width of the string in the original font is the same as with 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,pstoeditdisplays a'#'instead. See also the-ucharoption. โจ pstoeditsupports bitmap graphics only for some output format drivers.- Some output format drivers, e.g. the Gnuplot output format driver or the 3D output format driver (
rpl,lwo,rib) do not support text. - For most output format drivers
pstoeditdoes not support clipping (mainly due to limitations in the target format). You can try to use the-sclipoption to simulate clipping. However, this does not work in all cases as expected. ๐ฌ - Special note about the Java output format drivers (
java1andjava2). Thejava1andjava2drivers generate a java source file that needs other files in order to be compiled and usable. These other files are Java classes (one applet and support classes) that allow stepping through the individual pages of a converted PostScript document. This applet can easily be activated from a HTML-document. See thecontrib/java/java1/readme_java1.txtorcontrib/java/java2/readme_java2.htmfiles for more details. ๐
โ FAQS โ
- Why do letters like
OorBget strange if converted to TGIF/XFIG using the-dtoption?
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. ๐
- Why does
pstoeditproduce ugly results from PostScript files generated bydvips?
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 ๐
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 ๐
- Klaus Steinberger
Klaus.Steinberger_AT_physik.uni-muenchen.dewrote the initial version of this man-page. - Lar Kaufman revised the increasingly complex command syntax diagrams and updated the structure and content of this man-page following release 2.5.
- David B. Rosen
rosen_AT_unr.eduprovided ideas and some PostScript code from his ps2aplot program. - Ian MacPhedran
Ian_MacPhedran_AT_engr.USask.CAprovided the XFIG output format driver. - Carsten Hammer
chammer_AT_hermes.hrz.uni-bielefeld.deprovided the Gnuplot output format driver and the initial DXF output format driver. - Christoph Jaeschke provided the OS/2 metafile (MET) output format driver. Thomas Hoffmann
thoffman_AT_zappa.sax.dedid some further updates on the OS/2 part. - Jens Weber
rz47b7_AT_PostAG.DEprovided the MS Windows metafile (WMF) output format driver, and a graphical user interface (GUI). - G. Edward Johnson
lorax_AT_nist.govprovided the CGM Draw library used in the CGM output format driver. - Gerhard Kircher
kircher_AT_edvz.tuwien.ac.atprovided some bug fixes. - Bill Cheng
bill.cheng_AT_acm.orgprovided help with the TGIF format and some changes to TGIF to make the output format driver easier to implement. - Reini Urban
rurban_AT_sbox.tu-graz.ac.atprovided input for the extended DXF output format driver. - Glenn M. Lewis
glenn_AT_gmlewis.comprovided RenderMan (RIB), Real3D (RPL), and LightWave 3D (LWO) output format drivers. - Piet van Oostrum
piet_AT_cs.ruu.nlmade several bug fixes. - Lutz Vieweg
lkv_AT_mania.robin.deprovided several bug fixes and suggestions for improvements. - Derek B. Noonburg
derekn_AT_vw.ece.cmu.eduand Rainer Dorschrd_AT_berlepsch.wohnheim.uni-ulm.deisolated and resolved a Linux-specific core dump problem. - Rob Warner
rcw2_AT_ukc.ac.ukmadepstoeditcompile under RiscOS. - Patrick Gosling
jpmg_AT_eng.cam.ac.ukmade some suggestions regarding the usage ofpstoeditin Ghostscript's SAFER mode. - Scott Pakin
scott+ps2ed_AT_pakin.orgfor the Idraw output format driver and the autoconf support. - Peter Katzmann
p.katzmann_AT_thiesen.comfor the HPGL output format driver. - Chris Cox
ccox_AT_airmail.netcontributed the Tcl/Tk output format driver. - Thorsten Behrens
Thorsten_Behrens_AT_public.uni-hamburg.deand Bjoern Petersen for reworking the WMF output format driver. - Leszek Piotrowicz
leszek_AT_sopot.rodan.plimplemented the image support for the XFIG driver and a JAVA based GUI. - Egil Kvaleberg
egil_AT_kvaleberg.nocontributed the pic output format driver. - Kai-Uwe Sattler
kus_AT_iti.cs.uni-magdeburg.deimplemented the output format driver for Kontour. - Scott Pakin,
scott+ps2ed_AT_pakin.orgprovided the MetaPost and LaTeX2e and MS PowerPoint output format driver. - The MS PowerPoint driver (
pptx) uses the libzip library -https://libzip.org. Under MS Windows, libzip and libz are linked statically into the driver DLL. Thanks to the whole libzip team. The libzip license is explained herehttps://libzip.org/license. - Burkhard Plaum
plaum_AT_IPF.Uni-Stuttgart.deadded support for complex filled paths for the XFIG output format driver. - Bernhard Herzog
herzog_AT_online.decontributed the output format driver for sketch (http://www.skencil.org/) - Rolf Niepraschk (
niepraschk_AT_ptb.de) converted the HTML man page to LaTeX format. This allows generating the UNIX style and the HTML manual from this base format. - Several others sent smaller bug fixed and bug reports. Sorry if I do not mention them all here. ๐ญ
- Gisbert W. Selke (
gisbert_AT_tapirsoft.de) for the Java 2 output format driver. - Robert S. Maier (
rsm_AT_math.arizona.edu) for many improvements on the libplot output format driver and for libplot itself. - The authors of pstotext (
mcjones_AT_pa.dec.comandbirrell_AT_pa.dec.com) for giving me the permission to use their simple PostScript code for performing rotation. - Daniel Gehriger
gehriger_AT_linkcad.comfor his help concerning the handling of Splines in the DXF format. - Allen Barnett
libemf_AT_lignumcomputing.comfor his work on the libEMF which allows creating WMF/EMF files under *nix systems. - Dave
dave_AT_opaque.netfor providing the libming which is a multiplatform library for generating SWF files. - Masatake Yamoto for the introduction of autoconf, automake and libtool into
pstoedit - Bob Friesenhahn for his help and the building of the Magick++ API to ImageMagick.
- Barak Pearlmutter from Debian for his upfront testing of new versions.
- But most important: Peter Deutsch, Ken Sharp, Chris Liddell from the GhostScript team at Artifex, and Russell Lang
gsview_AT_ghostgum.com.aufor their help and answers regarding Ghostscript and gsview. ๐
โ๏ธ 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 the additional plugins.
Ghostscript is a redistributable software package with copyright restrictions controlled by Artifex https://artifex.com/.
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.
and that's the whole page bestie!! โจ๐๐ this iconic lil manual is from Conversion Tools, version/date stamp 04 February 2026, and you can cite it as PSTOEDIT(1) whenever you need to be cute and correct. slay, no cap, go convert something gorgeous ๐ ๐ฆ๐ธ
๐ฆ where this page comes from
- arch rolling: pstoedit 4.3-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms