man-pages/man1/pstopnm.1.html
2021-03-31 01:06:50 +01:00

462 lines
9.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of pstopnm</TITLE>
</HEAD><BODY>
<H1>pstopnm</H1>
Section: User Commands (1)<BR>Updated: 28 June 2000<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="ixAAB"></A>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
pstopnm - convert a PostScript file into a portable anymap
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>pstopnm</B>
[<B>-stdout</B>]
[<B>-forceplain</B>]
[<B>-help</B>]
[<B>-llx</B>
<I>s</I>]
[<B>-lly</B>
<I>s</I>]
[<B>-landscape</B>]
[<B>-portrait</B>]
[<B>-nocrop</B>]
[<B>-pbm</B>
|<B>-pgm</B>
|<B>-ppm</B>]
[<B>-urx</B>
<I>s</I>]
[<B>-ury</B>
<I>s</I>]
[<B>-verbose</B>]
[<B>-xborder</B>
<I>n</I>]
[<B>-xmax</B>
<I>n</I>]
[<B>-xsize</B>
<I>f</I>]
[<B>-yborder</B>
<I>f</I>]
[<B>-ymax</B>
<I>n</I>]
[<B>-ysize</B>
<I>n</I>]
<I>psfile</I>[<I></I><B>.ps</B>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Reads a PostScript file as input.
<A NAME="ixAAC"></A>
Produces PBM, PGM, or PPM files as output.
This program simply uses
<B>GhostScript</B>
to render a PostScript file with its PNM device drivers. If you don't
have
<B>GhostScript</B>
installed (invoked by a
<B>gs</B>
command), or the version you have installed was not built with the relevant
PNM device drivers,
<B>pstopnm</B>
will fail. You can see if you have the proper environment by issuing the
command
<B>gs --help </B>.
If it responds and lists under &quot;Available Devices&quot;
<B>pbm</B>,
<B>pbmraw</B>,
<B>pgm</B>,
<B>pgmraw</B>,
<B>pnm</B>,
<B>pnmraw</B>,
<B>ppm</B>,
or
<B>ppmraw</B>,
you're in business.
<P>
<B>pstopnm</B>
does not use the Netpbm libraries to generate the output files, so may
not be entirely consistent with most Netpbm programs.
<P>
<I>psfile</I>[<I></I><B>.ps</B>]
is the name of the input file.
<B>.pstopnm</B>
will add the
<B>ps</B>
to the end of the name you specify if no file exists by the exact name
you specify, but one with
added does. Use
<B>-</B>
to indicate Standard Input.
<P>
If you use the
<B>-stdout </B>
option,
<B>pstopnm</B>
outputs images of all the pages as a multi-image file to Standard
Output. Otherwise,
<B>pstopnm</B>
creates one file for each page in the Postscript document. The files
are named as follows: If the input file is named
<B>psfile.ps</B>,
the name of the files will be
<B>psfile001.ppm</B>,
<B>psfile002.ppm</B>,
etc. The filetype suffix is
<B>.ppm</B>,
<B>.pgm</B>,
or
<B>.pbm</B>,
depending on which kind of output you choose with your invocation
options. If the input file name does not end in
<B>.ps</B>,
the whole file name is used in the output file name. For example,
if the input file is named
<B>psfile.old</B>,
the output file name is
<B>psfile.old001.ppm</B>,
etc.
<P>
Note that the output file selection is inconsistent with most Netpbm
programs, because it does not default to Standard Output. This is for
historical reasons, based on the fact that the Netpbm formats did not
always provide for a sequence of images in a single file.
<P>
<P>
Each output file contains the image of a rectangular part of the page
to which it pertains. The selected area will always be centered in
the output file, and may have borders around it. The image area to be
extracted from the PostScript file and rendered into a portable anymap
is defined by four numbers, the lower left corner and the upper right
corner x and y coordinates. These coordinates are usually specified
by the BoundingBox comment in the PostScript file header, but they can
be overridden by the user by specifying one or more of the following
options:
<B>-llx</B>,
<B>-lly</B>,
<B>-urx</B>,
and
<B>-ury</B>.
The presence and thickness of a border to be left around the image
area is controlled by the use of the options
<B>-xborder</B>
and
<B>-yborder</B>.
If
<B>pstopnm </B>
does not find BoundingBox parameters in the input, and you don't
specify image area coordinates on the command line,
<B>pstopnm</B>
uses default values. If your input is from Standard Input,
<B>pstopnm</B>
does not use the BoundingBox parameters (due to the technical
difficulty of extracting that information and still feeding the file
to Ghostscript), so you either have to specify the image area
coordinates or take the default.
<P>
Unless you specify both output file width and height, via the
<B>-xsize </B>
and
<B>-ysize </B>
options,
<B>pstopnm </B>
maps the document into the output image by preserving its aspect
ratio.
<P>
It has been reported that on some Postscript Version 1 input, Ghostscript,
and therefore
<B>pstopnm</B>,
produces no output. To solve this problem, you can convert the file to
Postscript Version 3 with the program
<B>ps2ps</B>.
It is reported that the program
<B>pstops</B>
does not work.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-forceplain</B>
<DD>
forces the output file to be in plain (text) format. Otherwise, it is
in raw (binary) format. See
<B><A HREF="/cgi-bin/man/man2html?1+pbm">pbm</A></B>(1),
etc.
<DT id="2"><B>-llx </B><I>bx</I>
<DD>
selects
<I>bx</I>
as the lower left corner x coordinate (in inches).
<DT id="3"><B>-lly </B><I>by</I>
<DD>
selects
<I>by</I>
as the lower left corner y coordinate (in inches).
<DT id="4"><B>-landscape</B>
<DD>
renders the image in landscape mode.
<DT id="5"><B>-portrait</B>
<DD>
renders the image in portrait mode.
<DT id="6"><B>-nocrop</B>
<DD>
does not crop the output image dimensions to match the PostScript
image area dimensions.
<DT id="7"><B>-pbm -pgm -ppm</B>
<DD>
selects the format of the output file. By default, all files are
rendered as portable pixmaps (ppm format).
<DT id="8"><B>-stdout</B>
<DD>
causes output to go to Standard Output instead of to regular files,
one per page (see description of output files above). Use
<B>pnmsplit</B>
to extract individual pages from Standard Output.
<DT id="9"><B>-urx </B><I>tx</I>
<DD>
selects
<I>tx</I>
as the upper right corner x coordinate (in inches).
<DT id="10"><B>-ury </B><I>ty</I>
<DD>
selects
<I>ty</I>
as the upper right corner y coordinate (in inches).
<DT id="11"><B>-verbose</B>
<DD>
prints processing information to stdout.
<DT id="12"><B>-xborder </B><I>frac</I>
<DD>
specifies that the border width along the Y axis should be
<I>frac</I>
times the document width as specified by the bounding box comment in
the PostScript file header. The default value is 0.1.
<DT id="13"><B>-xmax </B><I>xs</I>
<DD>
specifies that the maximum output image width should have a size less
or equal to
<I>xs</I>
pixels (default: 612).
<DT id="14"><B>-xsize </B><I>xsize</I>
<DD>
specifies that the output image width must be exactly
<I>xs</I>
pixels.
<DT id="15"><B>-yborder </B><I>frac</I>
<DD>
specifies that the border width along the X axis should be
<I>frac</I>
times the document width as specified by the bounding box comment in
the PostScript file header. The default value is 0.1.
<DT id="16"><B>-ymax </B><I>ys</I>
<DD>
specifies that the maximum output image height should have a size less
or equal to
<I>ys</I>
pixels (default: 792).
<DT id="17"><B>-ysize </B><I>ys</I>
<DD>
specifies that the output image height must be exactly
<I>ys</I>
pixels.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>BUGS</H2>
The program will produce incorrect results with PostScript files that
initialize the current transformation matrix. In these cases, page
translation and rotation will not have any effect. To render these
files, probably the best bet is to use the following options:
<P>
&nbsp;&nbsp;&nbsp;pstopnm -xborder 0 -yborder 0 -portrait -nocrop file.ps
<P>
Additional options may be needed if the document is supposed to be
rendered on a medium different from letter-size paper.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+gs">gs</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pstofits">pstofits</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmtops">pnmtops</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+psidtopgm">psidtopgm</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pbmtolps">pbmtolps</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pbmtoepsi">pbmtoepsi</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmsplit">pnmsplit</A></B>(1)
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright (c) 1992 Smithsonian Astrophysical Observatory
<BR>
PostScript is a Trademark of Adobe Systems Incorporated.
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHOR</H2>
Alberto Accomazzi, WIPL, Center for Astrophysics.
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="18"><A HREF="#lbAB">NAME</A><DD>
<DT id="19"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="20"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="21"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="22"><A HREF="#lbAF">BUGS</A><DD>
<DT id="23"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="24"><A HREF="#lbAH">COPYRIGHT</A><DD>
<DT id="25"><A HREF="#lbAI">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:25 GMT, March 31, 2021
</BODY>
</HTML>