Developer's Daily | Unix by Example |
main | java | perl | unix | dev directory | web log |
pstopnm - convert a PostScript file into a portable anymap |
pstopnm [?forceplain] [?help] [?llx s] [?lly s] [?landscape] [?portrait] [?nocrop] [?pbm |?pgm |?ppm] [?urx s] [?ury s] [?verbose] [?xborder n] [?xmax n] [?xsize f] [?yborder f] [?ymax n] [?ysize n] psfile[.ps] |
Reads a PostScript file as input. Produces portable anymap files as output. This program is just a useful shell script that runs GhostScript to render a PostScript into one or more pnm files. Pstopnm will create as many files as the number of pages in the Postscript document. If the input file is named psfile.ps, the name of the files will be psfile001.ppm, psfile002.ppm, etc. The program maps a rectangular portion of the PostScript document into an image file according to the command line options. 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 flags: ?llx, ?lly, ?urx, and ?ury. The presence and thickness of a border to be left around the image area is controlled by the use of the flags ?xborder and ?yborder. If BoundingBox parameters are not found, and image area coordinates are not specified on the command line, default values are used. Unless both output file width and height are specified via the ?xsize and ?ysize flags, the program will map the document into the output image by preserving its aspect ratio. |
?forceplain |
forces the output file to be a plain (i.e. not "raw") portable anymap. |
?help |
prints the command syntax. |
?llx bx |
selects bx as the lower left corner x coordinate (in inches). |
?lly by |
selects by as the lower left corner y coordinate (in inches). |
?landscape |
renders the image in landscape mode. |
?portrait |
renders the image in portrait mode. |
?nocrop |
does not crop the output image dimensions to match the PostScript image area dimensions. |
?pbm ?pgm ?ppm |
selects the format of the output file. By default, all files are rendered as portable pixmaps (ppm format). |
?urx tx |
selects tx as the upper right corner x coordinate (in inches). |
?ury ty |
selects ty as the upper right corner y coordinate (in inches). |
?verbose |
prints processing information to stdout. |
?xborder frac |
specifies that the border width along the Y axis should be frac times the document width as specified by the bounding box comment in the PostScript file header. The default value is 0.1. |
?xmax xs |
specifies that the maximum output image width should have a size less or equal to xs pixels (default: 612). |
?xsize xs |
specifies that the output image width must be exactly xs pixels. |
?yborder frac |
specifies that the border width along the X axis should be frac times the document width as specified by the bounding box comment in the PostScript file header. The default value is 0.1. |
?ymax ys |
specifies that the maximum output image height should have a size less or equal to ys pixels (default: 792). |
?ysize ys |
specifies that the output image height must be exactly ys pixels. |
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 flags: pstopnm -xborder 0 -yborder 0 -portrait -nocrop file.ps Additional flags may be needed if the document is supposed to be rendered on a medium different from letter-size paper. |
gs(l), pstofits(l) |
Copyright (c) 1992 Smithsonian Astrophysical
Observatory |
Alberto Accomazzi, WIPL, Center for Astrophysics. |