{
    "mode": "man",
    "parameter": "pstopnm",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pstopnm/1/json",
    "generated": "2026-05-30T06:06:10Z",
    "synopsis": "pstopnm  [-stdout] [-forceplain] [-help] [-llx s] [-lly s] [-landscape] [-portrait] [-nocrop]\n[-pbm |-pgm |-ppm] [-urx s] [-ury s] [-verbose] [-xborder n] [-xmax n] [-xsize  f]  [-yborder\nf] [-ymax n] [-ysize n] psfile[.ps]",
    "sections": {
        "NAME": {
            "content": "pstopnm - convert a PostScript file into a portable anymap\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pstopnm  [-stdout] [-forceplain] [-help] [-llx s] [-lly s] [-landscape] [-portrait] [-nocrop]\n[-pbm |-pgm |-ppm] [-urx s] [-ury s] [-verbose] [-xborder n] [-xmax n] [-xsize  f]  [-yborder\nf] [-ymax n] [-ysize n] psfile[.ps]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a  PostScript file as input.  Produces PBM, PGM, or PPM files as output.  This program\nsimply uses GhostScript to render a PostScript file with its  PNM  device  drivers.   If  you\ndon't have GhostScript installed (invoked by a gs command), or the version you have installed\nwas not built with the relevant PNM device drivers, pstopnm will fail.  You can  see  if  you\nhave  the proper environment by issuing the command gs --help .  If it responds and lists un‐\nder \"Available Devices\" pbm, pbmraw, pgm, pgmraw, pnm, pnmraw,  ppm,  or  ppmraw,  you're  in\nbusiness.\n\npstopnm  does  not  use  the Netpbm libraries to generate the output files, so may not be en‐\ntirely consistent with most Netpbm programs.\n\npsfile[.ps] is the name of the input file.  .pstopnm will add the ps to the end of  the  name\nyou  specify if no file exists by the exact name you specify, but one with added does.  Use -\nto indicate Standard Input.\n\nIf you use the -stdout option, pstopnm outputs images of all the pages as a multi-image  file\nto Standard Output.  Otherwise, pstopnm creates one file for each page in the Postscript doc‐\nument.  The files are named as follows: If the input file is named psfile.ps, the name of the\nfiles will be psfile001.ppm, psfile002.ppm, etc.  The filetype suffix is .ppm, .pgm, or .pbm,\ndepending on which kind of output you choose with your invocation options.  If the input file\nname  does not end in .ps, the whole file name is used in the output file name.  For example,\nif the input file is named psfile.old, the output file name is psfile.old001.ppm, etc.\n\nNote that the output file selection is inconsistent with most  Netpbm  programs,  because  it\ndoes  not default to Standard Output.  This is for historical reasons, based on the fact that\nthe Netpbm formats did not always provide for a sequence of images in a single file.\n\n\nEach output file contains the image of a rectangular part of the page to which  it  pertains.\nThe selected area will always be centered in the output file, and may have borders around it.\nThe image area to be extracted from the PostScript file and rendered into a  portable  anymap\nis  defined by four numbers, the lower left corner and the upper right corner x and y coordi‐\nnates.  These coordinates are usually specified by the BoundingBox comment in the  PostScript\nfile  header, but they can be overridden by the user by specifying one or more of the follow‐\ning options: -llx, -lly, -urx, and -ury.  The presence and thickness of a border to  be  left\naround  the  image  area  is  controlled by the use of the options -xborder and -yborder.  If\npstopnm does not find BoundingBox parameters in the input, and you don't specify  image  area\ncoordinates on the command line, pstopnm uses default values.  If your input is from Standard\nInput, pstopnm does not use the BoundingBox parameters (due to the  technical  difficulty  of\nextracting that information and still feeding the file to Ghostscript), so you either have to\nspecify the image area coordinates or take the default.\n\nUnless you specify both output file width and height, via  the  -xsize  and  -ysize  options,\npstopnm maps the document into the output image by preserving its aspect ratio.\n\nIt  has  been  reported  that  on some Postscript Version 1 input, Ghostscript, and therefore\npstopnm, produces no output.  To solve this problem, you can convert the file  to  Postscript\nVersion 3 with the program ps2ps.  It is reported that the program pstops does not work.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-forceplain",
                    "content": "forces the output file to be in plain (text) format.  Otherwise, it is in raw (binary)\nformat.  See pbm(1), etc.\n"
                },
                {
                    "name": "-llx",
                    "content": "selects bx as the lower left corner x coordinate (in inches).\n"
                },
                {
                    "name": "-lly",
                    "content": "selects by as the lower left corner y coordinate (in inches).\n"
                },
                {
                    "name": "-landscape",
                    "content": "renders the image in landscape mode.\n"
                },
                {
                    "name": "-portrait",
                    "content": "renders the image in portrait mode.\n"
                },
                {
                    "name": "-nocrop",
                    "content": "does not crop the output image dimensions to match the PostScript  image  area  dimen‐\nsions.\n"
                },
                {
                    "name": "-pbm -pgm -ppm",
                    "content": "selects the format of the output file.  By default, all files are rendered as portable\npixmaps (ppm format).\n"
                },
                {
                    "name": "-stdout",
                    "content": "causes output to go to Standard Output instead of to regular files, one per page  (see\ndescription  of  output  files  above).  Use pnmsplit to extract individual pages from\nStandard Output.\n"
                },
                {
                    "name": "-urx",
                    "content": "selects tx as the upper right corner x coordinate (in inches).\n"
                },
                {
                    "name": "-ury",
                    "content": "selects ty as the upper right corner y coordinate (in inches).\n"
                },
                {
                    "name": "-verbose",
                    "content": "prints processing information to stdout.\n"
                },
                {
                    "name": "-xborder",
                    "content": "specifies that the border width along the Y axis should be  frac  times  the  document\nwidth as specified by the bounding box comment in the PostScript file header.  The de‐\nfault value is 0.1.\n"
                },
                {
                    "name": "-xmax",
                    "content": "specifies that the maximum output image width should have a size less or equal  to  xs\npixels (default: 612).\n"
                },
                {
                    "name": "-xsize",
                    "content": "specifies that the output image width must be exactly xs pixels.\n"
                },
                {
                    "name": "-yborder",
                    "content": "specifies  that  the  border  width along the X axis should be frac times the document\nwidth as specified by the bounding box comment in the PostScript file header.  The de‐\nfault value is 0.1.\n"
                },
                {
                    "name": "-ymax",
                    "content": "specifies  that the maximum output image height should have a size less or equal to ys\npixels (default: 792).\n"
                },
                {
                    "name": "-ysize",
                    "content": "specifies that the output image height must be exactly ys pixels.\n\n"
                }
            ]
        },
        "BUGS": {
            "content": "The program will produce incorrect results with PostScript files that initialize the  current\ntransformation  matrix.   In these cases, page translation and rotation will not have any ef‐\nfect.  To render these files, probably the best bet is to use the following options:\n\npstopnm -xborder 0 -yborder 0 -portrait -nocrop file.ps\n\nAdditional options may be needed if the document is supposed to be rendered on a medium  dif‐\nferent from letter-size paper.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gs(1), pstofits(1), pnmtops(1), psidtopgm(1), pbmtolps(1), pbmtoepsi(1), pnmsplit(1)\n\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 1992 Smithsonian Astrophysical Observatory\nPostScript is a Trademark of Adobe Systems Incorporated.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Alberto Accomazzi, WIPL, Center for Astrophysics.\n\n\n\n\n28 June 2000                                  pstopnm(1)",
            "subsections": []
        }
    },
    "summary": "pstopnm - convert a PostScript file into a portable anymap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "forces the output file to be in plain (text) format. Otherwise, it is in raw (binary) format. See pbm(1), etc."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "selects bx as the lower left corner x coordinate (in inches)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "selects by as the lower left corner y coordinate (in inches)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "renders the image in landscape mode."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "renders the image in portrait mode."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "does not crop the output image dimensions to match the PostScript image area dimen‐ sions."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "selects the format of the output file. By default, all files are rendered as portable pixmaps (ppm format)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "causes output to go to Standard Output instead of to regular files, one per page (see description of output files above). Use pnmsplit to extract individual pages from Standard Output."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "selects tx as the upper right corner x coordinate (in inches)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "selects ty as the upper right corner y coordinate (in inches)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "prints processing information to stdout."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 de‐ fault value is 0.1."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "specifies that the maximum output image width should have a size less or equal to xs pixels (default: 612)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "specifies that the output image width must be exactly xs pixels."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 de‐ fault value is 0.1."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "specifies that the maximum output image height should have a size less or equal to ys pixels (default: 792)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "specifies that the output image height must be exactly ys pixels."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "gs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gs/1/json"
        },
        {
            "name": "pstofits",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pstofits/1/json"
        },
        {
            "name": "pnmtops",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmtops/1/json"
        },
        {
            "name": "psidtopgm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/psidtopgm/1/json"
        },
        {
            "name": "pbmtolps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbmtolps/1/json"
        },
        {
            "name": "pbmtoepsi",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbmtoepsi/1/json"
        },
        {
            "name": "pnmsplit",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmsplit/1/json"
        }
    ]
}