EnglishFrenchSpanish

OnWorks favicon

pstoimg - Online in the Cloud

Run pstoimg in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command pstoimg that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


pstoimg - Convert a PostScript file to a bitmap image using Ghostscript and the Netpbm
utilities

SYNOPSIS


pstoimg -help | -version

pstoimg [ -antialias ] [ -aaliastext ] [ -center num ] [ -color num ] [ -crop code ]
[ -debug ] [ -density num] [ -depth num ] [ -discard ] [ -flip code ] [ -geometry XxY ]
[ -interlaced ] [ -margins X,Y ] [ -multipage ] [ -out file ] [ -quiet ]
[ -rightjustify num ] [ -scale num ] [ -tmp path ] [ -topjustify [x]num ] [ -transparent ]
[ -type type ] [ -shoreup num[d] ] [ -white ] file [ file2 ... ]

OPTIONS


The command line options may be abbreviated to the shortest unique prefix.

-help
Show this help page and exit.

-version
Show the release and version of pstoimg and exit.

-antialias
Use Ghostscript's anti-aliasing feature for rendering "softer" images. This applies
to lines and edges of polygonal and oval or circular shapes. Only valid if
Ghostscript 4.03 or higher is installed.

-aaliastext
Use Ghostscript's anti-aliasing feature for "smoother" font characters, without the
jagged edges. Similar to -antialias for graphic components. Only valid if Ghostscript
4.03 or higher is installed.

-center num
Add the appropriate amount of whitespace to the left of the image so that the image
appears to be centered in a total width of num pixels.

-crop code
Crop the bitmap from the given directions. code may be a string of several cropping
instructions, which are executed strictly in the given order. Possible values are: h
(horizontal, i.e. crop top and bottom), v (vertical), tblr (top, bottom, left, right)
and a (all directions). A special case is s: "shave" the image at the bottom, but only
if a single line of whitespace exists.

-debug
Turn on debugging output. This can get rather verbose. Any intermediate files
generated are not removed to help debugging.

-density num
The density (resolution) in DPI in which to render the bitmap. The default is 72.

-depth num or -color num
Specify the color depth of the bitmap. Legal values are 1 (black & white), 8 (256
colors) and 24 (true color).

-discard
Delete the input postscript file if the conversion was successful. Setting the
environment DISCARD to a true value (as perl sees it) has the same effect.

-flip code
Flip all generated output bitmaps. The following codes are recognized: lr (flip left-
right), tb (flip top-bottom), xy (flip bottom/left-top/right), r90 and ccw (rotate by
90 degrees counterclockwise), r270 and cw (rotate 90 degrees clockwise) and r180
(rotate 180 degrees).

-geometry XxY
Render only this "window" of the PostScript file. If given, this option can
dramatically reduce memory requirements and speed up conversion. The geometry is
automatically detected in case of EPS files (Encapsulated PostScript).

-interlaced
Generate an interlaced bitmap. Interlaced images build up from coarse to fine as they
are loaded. This option may not work on every installation and/or bitmap type,
depending of the capabilities of external programs.

-margins X,Y
The offset of the rectangle in the postscript file that is going to be rendered from
top/left. Can be used together with -geometry to further reduce the size of the
intermediate bitmap file generated by Ghostscript.

-multipage
Process a multi-page PostScript file, i.e. create an individual bitmap for every page.
The resulting files are numbered: The decimal number (starting with 1) is appended to
the basename of the PostScript input file (or the basename of the filename specified
with -out), while keeping the extension.

-out file
The file where to write the bitmap. If multiple PostScript files are supplied on the
command line, this option is ignored. The bitmap type extension is appended
automatically if file does not contain a dot. In connection with -multipage file is
extended by the page number as shown in this example:

-outfile foo.gif --------> foo1.gif, foo2.gif, ...

-quiet
Do not print anything except error messages.

-rightjustify num
Add the appropriate amount of whitespace to the left of the image so that it appears
to be aligned to the right in a total width of num pixels.

-scale factor
Scale the image by factor. Valid choices are any numbers greater than zero. Useful
choices are numbers between 0.1 - 5. Large numbers may generate very large
intermediate files and will take longer to process. If this option is omitted, the
environment SCALE is considered.

-shoreup num[d]
Make height and width of the bitmap(s) an exact multiple of num. If num is followed by
a "d", then half the extra vertical space is placed underneath. This option is useful,
if you want to have "blown-up" images of high quality for print, but downscale them in
HTML using "<IMG WIDTH=x HEIGHT=y>". If the actual image is is not an integer multiple
of x,y then browsers tend to display distorted images.

-tmp path
Use path to store temporary files. Defaults to /tmp on this installation. This
parameter can be set by the environment TMP or TEMP, too.

-topjustify [x]num
Add padding whitespace to the image so that it gets a defined height. If an integer
value is given, it defines the total height. The whitespace is added at the bottom. If
the number is preceded by "x", then this multiple of the image height is added as
whitespace at the bottom.

-transparent
Generate transparent bitmaps, i.e. the background color (white) is transparent if
viewed with certain viewers (e.g. browsers). This option may not be available due to
missing capabilities of external programs.

-type type
Instruct pstoimg to render the bitmap in type format. Depending on the local
installation, pstoimg is capable of generating either GIF or PNG bitmaps. This site
features the following types: png gif

If omitted, the first type in this list is taken.

-white
Remove TeX's page color information from the PostScript file before converting so that
a white background is used.

DESCRIPTION


pstoimg iterates over the given input files and runs them through Ghostscript. The
resulting pnm (portable anymap files) are processed with different Netpbm tools (cropping,
color mapping, aligning, ...) and finally converted into (currently) either GIF or PNG
format. The bitmaps can now be included e.g. in WWW pages.

The PostScript file is converted as is. If a valid bounding box is found (EPS format),
then only this area is converted. The image is not cropped by default.

RETURN VALUE


0 if everything went all right

x (x != 0) something went wrong. See the message output.

EXAMPLES


"pstoimg foo.ps"
Convert the first page of foo.ps to the default bitmap type.

"pstoimg -type png -crop a -trans -interlace foo.ps"
Same as above, but force png output and crop all the whitespace around the image and
make the color white transparent and generate an interlaced bitmap.

"pstoimg -multi -out bar -type gif -crop a foo.ps"
Consider foo.ps a multiple page PostScript file and create output files bar1.gif,
bar2.gif, etc.

ENVIRONMENT


DENSITY, DEPTH, DEBUG, DISCARD
See -density, -depth, -debug, -discard, respectively.

GS_LIB
This variable is set to the path(s) where Ghostscript libraries have been found on
this system during configuration, but only if the built-in paths are not correct. This
fixes the problem of relocation that is quite common on Win32 installations. This
behavior can be overridden by setting GS_LIB manually before starting pstoimg.

LATEX2HTMLDIR
The directory where the LaTeX2HTML library and perl modules are found. Defaults to
"/usr/share/latex2html" on this installation.

OUTFILE
Setting this has the same effect as specifying -out. Please do not rely on this
feature any more, it will disappear from the next releases!

PAPERSIZE
The papersize to use by Ghostscript to render the image. pstoimg tries hard to
optimize for rendering on the smallest possible bitmap size. Still this option is
there to enable tuning by hand, although it is deprecated. If pstoimg finds a better
setting, this parameter is ignored.

SCALE
See the discussion of -scale.

TMP and TEMP
Unless overridden by -tmp, these variables denote a directory where to store temporary
files. TMP is considered first, then TEMP.

Use pstoimg online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    PostInstallerF
    PostInstallerF
    PostInstallerF will install all the
    software that Fedora Linux and others
    doesn't include by default, after
    running Fedora for the first time. Its
    easy for...
    Download PostInstallerF
  • 2
    strace
    strace
    The strace project has been moved to
    https://strace.io. strace is a
    diagnostic, debugging and instructional
    userspace tracer for Linux. It is used
    to monitor a...
    Download strace
  • 3
    gMKVExtractGUI
    gMKVExtractGUI
    A GUI for mkvextract utility (part of
    MKVToolNix) which incorporates most (if
    not all) functionality of mkvextract and
    mkvinfo utilities. Written in C#NET 4.0,...
    Download gMKVExtractGUI
  • 4
    JasperReports Library
    JasperReports Library
    JasperReports Library is the
    world's most popular open source
    business intelligence and reporting
    engine. It is entirely written in Java
    and it is able to ...
    Download JasperReports Library
  • 5
    Frappe Books
    Frappe Books
    Frappe Books is a free and open source
    desktop book-keeping software that's
    simple and well-designed to be used by
    small businesses and freelancers. It'...
    Download Frappe Books
  • 6
    Numerical Python
    Numerical Python
    NEWS: NumPy 1.11.2 is the last release
    that will be made on sourceforge. Wheels
    for Windows, Mac, and Linux as well as
    archived source distributions can be fou...
    Download Numerical Python
  • More »

Linux commands

Ad