{
    "content": [
        {
            "type": "text",
            "text": "# ppmdraw (man)\n\n## NAME\n\nppmdraw - draw lines, text, etc on a PPM image\n\n## DESCRIPTION\n\nThis program is part of Netpbm(1).\n\n## TLDR\n\n> Draw lines, text, and more on a PPM image by executing a script.\n\n- Draw on the specified PPM image by executing the supplied script:\n  `ppmdraw -script '{{setpos 50 50; text_here \"hello!\"; }}' {{path/to/image.pnm}} > {{path/to/output.pnm}}`\n- Draw on the specified PPM image by executing the script in the specified file:\n  `ppmdraw -scriptfile {{path/to/script}} {{path/to/image.pnm}} > {{path/to/output.pnm}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION** (1 subsections)\n- **OPTIONS** (2 subsections)\n- **SCRIPT**\n- **HISTORY**\n- **SEE ALSO**\n- **DOCUMENT SOURCE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "ppmdraw",
        "section": "",
        "mode": "man",
        "summary": "ppmdraw - draw lines, text, etc on a PPM image",
        "synopsis": "",
        "tldr_summary": "Draw lines, text, and more on a PPM image by executing a script.",
        "tldr_examples": [
            {
                "description": "Draw on the specified PPM image by executing the supplied script",
                "command": "ppmdraw -script '{{setpos 50 50; text_here \"hello!\"; }}' {{path/to/image.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Draw on the specified PPM image by executing the script in the specified file",
                "command": "ppmdraw -scriptfile {{path/to/script}} {{path/to/image.pnm}} > {{path/to/output.pnm}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option gives the script. See \u001b]8;;#script\u001b\\Script\u001b]8;;\u001b\\ . You may not specify both -script and -scriptfile."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option names a file that contains the script. - means Standard Input. You may not specify both -script and -scriptfile. You may not specify - (Standard Input) for both -scriptfile and the input image file."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "ppmlabel",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmlabel/1/json"
            },
            {
                "name": "ppm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppm/1/json"
            },
            {
                "name": "libnetpbmdraw",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/libnetpbmdraw/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "ppmdraw",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": [
                    {
                        "name": "-scriptfile  -script",
                        "lines": 26
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 6,
                "subsections": [
                    {
                        "name": "-script=_",
                        "lines": 5
                    },
                    {
                        "name": "-scriptfile=_",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "SCRIPT",
                "lines": 136,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DOCUMENT SOURCE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "ppmdraw - draw lines, text, etc on a PPM image\n\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "ppmdraw",
                        "content": "{ -script=script | -scriptfile=filename } [-verbose]\n\n[ppmfile]\n\nAll  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐\nstead of one to designate an option.  You may use either white space or an  equals  sign  be‐\ntween an option name and its value.\n\n\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "This program is part of Netpbm(1).\n\nppmdraw draws lines, shapes, text, etc. on a PPM image.  It is essentially an easy-to-program\nfront  end  to libnetpbm's \"ppmd\" subroutines.  It lets you create a human-friendly script to\ndescribe the drawing rather than write a C program.\n\nYou supply drawing instructions with a script, which you supply either in a file named  by  a",
                "subsections": [
                    {
                        "name": "-scriptfile  -script",
                        "content": "setpos 50 50;\ntexthere 10 30 \"hello\";\nsetcolor black;\ntexthere 10 0 \"there\";\nlinehere 5 20;\n\n\nThis example starts at Column 50, Row 50 of the input image and writes the word \"hello\" there\nin  10  pixel  high  white letters at a 30 degree angle up from horizontal.  Then, from where\nthat leaves off, the script writes \"there\" in 10 pixel high black letters horizontally.   Fi‐\nnally,  it  draws  a  black  line to a point 5 pixels over and 20 pixels down from the end of\n\"there.\"\n\nIf you don't specify ppmfile, ppmdraw reads its input PPM image from Standard Input.\n\nThe output image goes to Standard Output.\n\nppmdraw works on multi-image streams.  It executes the same script on each  input  image  and\nproduces an output stream with one image for each input image.  But before Netpbm 10.32 (Feb‐\nruary 2006), ppmdraw ignored every image after the first.\n\nIf  you  just  want  to  add a single line of text to an image, ppmlabel may be more what you\nwant.\n\n\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "In addition to the options common to all programs based on libnetpbm  (most  notably  -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), ppmdraw recognizes the following command line options:\n\n\n\n",
                "subsections": [
                    {
                        "name": "-script=_",
                        "content": "This option gives the script.  See \u001b]8;;#script\u001b\\Script\u001b]8;;\u001b\\ .\n\nYou may not specify both -script and -scriptfile.\n\n"
                    },
                    {
                        "name": "-scriptfile=_",
                        "content": "This option names a file that contains the script.  - means Standard Input.\n\nYou may not specify both -script and -scriptfile.\n\nYou may not specify - (Standard Input) for both -scriptfile and the input image file.\n\n\n\n\n"
                    }
                ]
            },
            "SCRIPT": {
                "content": "The  heart  of ppmdraw function is its script.  The script is a character stream.  The stream\nconsists of commands.  Commands are separated by semicolons.  White space  is  regarded  just\nlike  in  C:  Any  contiguous stretch of unquoted white space is equivalent to a single space\ncharacter.  Note that this means newlines have no particular significance.\n\nA command is composed of tokens, separated from each other by white space.  To write a  token\nthat  contains white space, enclose it in double quotes.  Everything between two matched quo‐\ntation marks is one token.\n\nThe first token of a command is the verb, which determines the basic function of the command.\nThe rest of the tokens of the command are arguments, the meaning of which  depends  upon  the\nverb.   The  following list gives all the valid verbs, and for each its meaning and its argu‐\nments.\n\nMany command have arguments that specify a position on the canvas, which you specify  by  row\nand  column.   Row 0 is the top row.  Column 0 is the leftmost column.  You may specify nega‐\ntive numbers (but such a position would necessarily be off the canvas).\n\nYour drawing instructions may involve positions not on the canvas.  But any pixels  you  draw\nthere just get discarded.\n\n\n\nsetpos Set  the \"current position\" in the image.  This affects where subsequent commands draw\nthings.  The 2 arguments are the column and row number.\n\nAt the start of the script, the current position is (0,0).\n\n\nsetlinetype\nThe 1 argument is \"normal\" or \"nodiag.\".   This  effects  a  ppmdsetlinetype()  call.\nFurther details are not yet documented.\n\n\nsetlineclip\nThis effects a ppmdsetlineclip() call.  Not yet documented.\n\n\nsetcolor\nThis  sets the \"current color\", which determines the color in which subsequent drawing\ncommands draw.  Before the first setcolor, the current color is white.\n\nThere is one argument.  It specifies the color as described  for  the  \u001b]8;;libnetpbmimage.html#colorname\u001b\\argument of the\npnmparsecolor() library routine\u001b]8;;\u001b\\ .\n\n\nsetfont\nThis sets the \"current font\", which determines the font in which subsequent text draw‐\ning  commands  draw.   Before  the  first setfont, the current font is a built in font\ncalled \"standard.\"\n\nThe argument of this command is a file name.  It is the name of  a  Netpbm  PPMD  font\nfile.\n\nA  Netpbm PPMD font file typically has a name that ends in \".ppmdfont\" and its first 8\nbytes are the ASCII encoding of \"ppmdfont\".\n\nThere is only one of these fonts as far as we know.  It is distributed with Netpbm  as\nthe  file standard.ppmdfont, but you don't need to use that file because the same font\nis built into the Netpbm library and is the default.  If you want to make a new  font,\nyou  can  find the format of a ppmdfont file in the Netpbm interface header file ppmd‐\nfont.h, but you'll have to make your own tools to build it.   The  program  ppmdmkfont\ngenerates standard.ppmdfont, so you can use that as an example.\n\n\nline   This  draws a one pixel wide line in the current color.  The 4 arguments are: starting\ncolumn, starting row, ending column, ending row.\n\nThis command does not affect the current position.\n\n\nlinehere\nThis is like line, except it works in a more relative way.\n\nThe line starts at the current point.  The two arguments are the rightward  and  down‐\nward displacement from there to the terminal point.  The command moves the current po‐\nsition to the terminal point after drawing.\n\n\nspline3\nThis  draws a spline in the current color between 2 points, using a third as a control\npoint.  It approximates a cubic spline segment.\n\nThe shape of the curve is such that it passes through  the  specified  endpoints,  and\nlines  tangent  to  the curve at those endpoints intersect at the control point.  Con‐\ntrolling the tangents allows you to connect this curve to other curves  generated  the\nsame way without having corners at the connection points.\n\nThe  6 arguments are the starting point column, starting point row, control point col‐\numn, control point row, ending point column, and ending point row.\n\nThis command does not affect the current position.\n\n\ncircle This command draws a circle in the current color.  The three arguments are the  column\nnumber and row number of the center of the circle and the radius of the circle in pix‐\nels.\n\n\nfilledrectangle\nThis command draws a rectangle filled with the current color.\n\nThe 4 arguments are the column and row numbers of the upper left corner of the rectan‐\ngle, the width of the rectangle, and the height of the rectangle.\n\n\ntext   This  command  draws  text in the current color in the built-in font.  The 5 arguments\nare:\n\n\n\n•      column number of starting point of baseline\n\n•      row number of starting point of baseline\n\n•      height of characters, in pixels\n\n•      angle of baseline in degrees elevated from the horizontal\n\n•      text\n\n\nNote that if your text contains white space, you'll have to use double quotes to cause\nit to be a single token.\n\n\ntexthere\nThis is like text, except that the baseline starts at the  current  position  and  the\ncommand updates the current position to the other end of the baseline after it draws.\n\nBear in mind that a script starts with the current position in the top line, so if you\nleave it there, only the bottom line of your text will be within the image!\n\n\n\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "ppmdraw was new in Netpbm 10.29 (August 2005).\n\n\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "ppmlabel(1), ppm(1) libnetpbmdraw(1)\n",
                "subsections": []
            },
            "DOCUMENT SOURCE": {
                "content": "This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/ppmdraw.html\n\nnetpbm documentation                        22 June 2005                      Ppmdraw User Manual(1)",
                "subsections": []
            }
        }
    }
}