{
    "content": [
        {
            "type": "text",
            "text": "# PDF::Create::Page (perldoc)\n\n## NAME\n\nPDF::Create::Page - PDF pages tree for PDF::Create\n\n## DESCRIPTION\n\nFOR INTERNAL USE ONLY\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **DESCRIPTION**\n- **METHODS**\n- **AUTHORS**\n- **REPOSITORY**\n- **COPYRIGHT**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "PDF::Create::Page",
        "section": "",
        "mode": "perldoc",
        "summary": "PDF::Create::Page - PDF pages tree for PDF::Create",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 239,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "REPOSITORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "PDF::Create::Page - PDF pages tree for PDF::Create\n",
                "subsections": []
            },
            "VERSION": {
                "content": "Version 1.46\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "FOR INTERNAL USE ONLY\n",
                "subsections": []
            },
            "METHODS": {
                "content": "add($id, $name)\nAdds a page to the PDF document.\n\ncount()\nReturns page count.\n\nkids()\nReturns ref to a list of page ids.\n\nlist()\nReturns page list.\n\nnewpage()\nReturn new page.\n\nmoveto($x, $y)\nMoves the current point to (x, y), omitting any connecting line segment.\n\nlineto($x, $y)\nAppends a straight line segment from the current point to (x, y).\n\ncurveto($x1, $y1, $x2, $y2, $x3, $y3)\nAppends a Bezier curve to the path. The curve extends from the current point to (x3 ,y3) using\n(x1 ,y1) and (x2 ,y2) as the Bezier control points.The new current point is (x3 ,y3).\n\nrectangle($x, $y, $w, $h)\nAdds a rectangle to the current path.\n\nclosepath()\nCloses the current subpath by appending a straight line segment from the current point to the\nstarting point of the subpath.\n\nnewpath()\nEnds the path without filling or stroking it.\n\nstroke()\nStrokes the path.\n\nclosestroke()\nCloses and strokes the path.\n\nfill()\nFills the path using the non-zero winding number rule.\n\nfill2()\nFills the path using the even-odd rule.\n\nline($x1, $y1, $x2, $y2)\nDraw a line between ($x1, $y1) and ($x2, $y2). Combined moveto / lineto / stroke command.\n\nsetwidth($w)\nSet the width of subsequent lines to \"w\" points.\n\nsetgray($value)\nSets the color space to DeviceGray and sets the gray tint to use for filling paths.\n\nsetgraystroke($value)\nSets the color space to DeviceGray and sets the gray tint to use for stroking paths.\n\nsetrgbcolor($r, $g, $b)\nSets the fill colors used for normal text or filled objects.\n\nsetrgbcolorstroke($r, $g, $b)\nSet the color of the subsequent drawing operations. Valid r, g, and b values are each between\n0.0 and 1.0, inclusive.\n\nEach color ranges from 0.0 to 1.0, i.e., darkest red (0.0) to brightest red(1.0). The same holds\nfor green and blue. These three colors mix additively to produce the colors between black (0.0,\n0.0, 0.0) and white (1.0, 1.0, 1.0).\n\nPDF distinguishes between the stroke and fill operations and provides separate color settings\nfor each.\n\ntext(%params)\nRenders the text. Parameters are explained as below:\n\n+--------+------------------------------------------------------------------+\n| Key    | Description                                                      |\n+--------+------------------------------------------------------------------+\n| start  | The start marker, add directive BT                               |\n| end    | The end marker, add directive ET                                 |\n| text   | Text to add to the pdf                                           |\n| F      | Font index to be used, add directive /F<fontindex>              |\n| Tf     | Font size for the text, add directive <fontsize> Tf             |\n| Ts     | Text rise (super/subscript), add directive <mode> Ts             |\n| Tr     | Text rendering mode, add directive <mode> Tr                     |\n| TL     | Text leading, add directive <number> TL                          |\n| Tc     | Character spacing, add directive <number> Tc                     |\n| Tw     | Word spacing, add directive <number> Tw                          |\n| Tz     | Horizontal scaling, add directive <number> Tz                    |\n| Td     | Move to, add directive <x> <y> Td                                |\n| TD     | Move to and set TL, add directive <x> <y> TD                     |\n| rot    | Move to and rotate (<r> <x> <y>), add directive                  |\n|        | <cos(r)>, <sin(r)>, <sin(r)>, <cos(r)>, <x>, <y> Tm              |\n| T*     | Add new line.                                                    |\n+--------+------------------------------------------------------------------+\n\nstring($font, $size, $x, $y, $text $alignment)\nAdd text to the current page using the font object at the given size and position. The point (x,\ny) is the bottom left corner of the rectangle containing the text.\n\nThe optional alignment can be 'r' for right-alignment and 'c' for centered.\n\nExample :\n\nmy $f1 = $pdf->font(\n'Subtype'  => 'Type1',\n'Encoding' => 'WinAnsiEncoding',\n'BaseFont' => 'Helvetica'\n);\n\n$page->string($f1, 20, 306, 396, \"some text\");\n\nstringunderline($font, $size, $x, $y, $text, $alignment)\nDraw a line for underlining.The parameters are the same as for the string function but only the\nline is drawn. To draw an underlined string you must call both,string and stringunderline. To\nchange the color of your text use the \"setrgbcolor()\". It returns the length of the string. So\nits return value can be used directly for the bounding box of an annotation.\n\nExample :\n\n$page->string($f1, 20, 306, 396, \"some underlined text\");\n\n$page->stringunderline($f1, 20, 306, 396, \"some underlined text\");\n\nstringl($font, $size, $x, $y $text)\nSame as \"string()\".\n\nstringr($font, $size, $x, $y, $text)\nSame as \"string()\" but right aligned (alignment 'r').\n\nstringc($font, $size, $x, $y, $text)\nSame as \"string()\" but centered (alignment 'c').\n\nstringwidth($font, $text)\nReturn the size of the text using the given font in default user space units.This does not\ncontain the size of the font yet, to get the length you must multiply by the font size.\n\nprintnl($text, $font, $size, $x, $y)\nSimilar to \"string()\" but parses the string for newline and prints each part on a separate line.\nLines spacing is the same as the font-size.Returns the number of lines.\n\nNote the different parameter sequence.The first call should specify all parameters, font is the\nabsolute minimum, a warning will be given for the missing y position and 800 will be assumed.\nAll subsequent invocations can omit all but the string parameters.\n\nATTENTION:There is no provision for changing pages.If you run out of space on the current page\nthis will draw the string(s) outside the page and it will be invisible.\n\nblocktext(\\%params)\nAdd block of text to the page. Parameters are explained as below:\n\n+------------+--------------------------------------------------------------+\n| Key        | Description                                                  |\n+------------+--------------------------------------------------------------+\n| page       | Object of type PDF::Create::Page                             |\n| font       | Font index to be used.                                       |\n| text       | Text block to be used.                                       |\n| fontsize  | Font size for the text.                                      |\n| textcolor | Text color as arrayref i.e. [r, g, b]                        |\n| linewidth | Line width (in points)                                       |\n| starty    | First row number (in points) when adding new page.           |\n| endy      | Last row number (in points) when to add new page.            |\n| x          | x co-ordinate to start the text.                             |\n| y          | y co-ordinate to start the text.                             |\n+------------+--------------------------------------------------------------+\n\nuse strict; use warnings;\nuse PDF::Create;\n\nmy $pdf  = PDF::Create->new('filename'=>\"$0.pdf\", 'Author'=>'MANWAR', 'Title'=>'Create::PDF');\nmy $root = $pdf->newpage('MediaBox' => $pdf->getpagesize('A4'));\nmy $page = $root->newpage;\nmy $font = $pdf->font('BaseFont' => 'Helvetica');\n\n$page->rectangle(30, 780, 535, 40);\n$page->setrgbcolor(0,1,0);\n$page->fill;\n\n$page->setrgbcolorstroke(1,0,0);\n$page->line(30, 778, 565, 778);\n\n$page->setrgbcolor(0,0,1);\n$page->string($font, 15, 102, 792, 'MANWAR - PDF::Create');\n\nmy $text = qq{\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into ele-It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions\n};\n\n$page->blocktext({\npage       => $page,\nfont       => $font,\ntext       => $text,\nfontsize  => 6,\ntextcolor => [0,0,1],\nlinewidth => 535,\nstarty    => 780,\nendy      => 60,\n'x'        => 30,\n'y'        => 770,\n});\n\n$pdf->close;\n\nimage(%params)\nInserts an image. Parameters can be:\n\n+----------------+----------------------------------------------------------+\n| Key            | Description                                              |\n+----------------+----------------------------------------------------------+\n|                |                                                          |\n| image          | Image id returned by PDF::image (required).              |\n|                |                                                          |\n| xpos, ypos     | Position of image (required).                            |\n|                |                                                          |\n| xalign, yalign | Alignment of image.0 is left/bottom, 1 is centered and 2 |\n|                | is right, top.                                           |\n|                |                                                          |\n| xscale, yscale | Scaling of image. 1.0 is original size.                  |\n|                |                                                          |\n| rotate         | Rotation of image.0 is no rotation,2*pi is 360° rotation.|\n|                |                                                          |\n| xskew, yskew   | Skew of image.                                           |\n|                |                                                          |\n+----------------+----------------------------------------------------------+\n\nExample jpeg image:\n\n# include a jpeg image with scaling to 20% size\nmy $jpg = $pdf->image(\"image.jpg\");\n\n$page->image(\n'image'  => $jpg,\n'xscale' => 0.2,\n'yscale' => 0.2,\n'xpos'   => 350,\n'ypos'   => 400\n);\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Fabien Tassin\n\nGIF and JPEG-support: Michael Gross (info@mdgrosse.net)\n\nMaintenance since 2007: Markus Baertschi (markus@markus.org)\n\nCurrently maintained by Mohammad S Anwar (MANWAR) \"<mohammad.anwar at yahoo.com>\"\n",
                "subsections": []
            },
            "REPOSITORY": {
                "content": "<https://github.com/manwar/pdf-create>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 1999-2001,Fabien Tassin.All rights reserved.It may be used and modified freely, but I\ndo request that this copyright notice remain attached to the file. You may modify this module as\nyou wish,but if you redistribute a modified version, please attach a note listing the\nmodifications you have made.\n\nCopyright 2007 Markus Baertschi\n\nCopyright 2010 Gary Lieberman\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This is free software; you can redistribute it and / or modify it under the same terms as Perl\n5.6.0.\n",
                "subsections": []
            }
        }
    }
}