.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PDF::Builder::Lite 3" .TH PDF::Builder::Lite 3 2023-12-21 "perl v5.38.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PDF::Builder::Lite \- Lightweight PDF creation methods .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 5 \& $pdf = PDF::Builder::Lite\->new(); \& $pdf\->page(595,842); \& $img = $pdf\->image(\*(Aqsome.jpg\*(Aq); \& $font = $pdf\->corefont(\*(AqTimes\-Roman\*(Aq); \& $font = $pdf\->ttfont(\*(AqTimesNewRoman.ttf\*(Aq); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This class is unmaintained (since 2007) and should not be used in new code. It combines many of the methods from PDF::Builder and PDF::Builder::Content into a single class but isn't really otherwise any easier to use. .PP There have been many improvements and clarifications made to the rest of the distribution that aren't reflected here, so the term "Lite" no longer applies. It remains solely for compatibility with existing legacy code. .SH METHODS .IX Header "METHODS" .SS new .IX Subsection "new" .Vb 1 \& $pdf = PDF::Builder::Lite\->new(%opts) \& \& $pdf = PDF::Builder::Lite\->new() .Ve .SS page .IX Subsection "page" .Vb 1 \& $pdf\->page() \& \& $pdf\->page($width,$height) \& \& $pdf\->page($llx,$lly, $urx,$ury) .Ve .Sp .RS 4 Opens a new page. .RE .SS mediabox .IX Subsection "mediabox" .Vb 1 \& $pdf\->mediabox($w,$h) \& \& $pdf\->mediabox($llx,$lly, $urx,$ury) .Ve .Sp .RS 4 Sets the global mediabox. .RE .SS saveas .IX Subsection "saveas" .Vb 1 \& $pdf\->saveas($file) .Ve .Sp .RS 4 Saves the document (may \fBnot\fR be modified later) and deallocates the PDF structures. .Sp If \f(CW$file\fR is just a hyphen '\-', the stringified copy is returned, otherwise the file is saved, and \f(CW$self\fR is returned (for chaining calls). .RE .SS corefont .IX Subsection "corefont" .Vb 1 \& $font = $pdf\->corefont($fontname) .Ve .Sp .RS 4 Returns a new or existing Adobe core font object. .Sp \&\fBExamples:\fR .Sp .Vb 4 \& $font = $pdf\->corefont(\*(AqTimes\-Roman\*(Aq); \& $font = $pdf\->corefont(\*(AqTimes\-Bold\*(Aq); \& $font = $pdf\->corefont(\*(AqHelvetica\*(Aq); \& $font = $pdf\->corefont(\*(AqZapfDingbats\*(Aq); .Ve .RE .SS ttfont .IX Subsection "ttfont" .Vb 1 \& $font = $pdf\->ttfont($ttfile) .Ve .Sp .RS 4 Returns a new or existing TrueType font object. .Sp \&\fBExamples:\fR .Sp .Vb 3 \& $font = $pdf\->ttfont(\*(AqTimesNewRoman.ttf\*(Aq); \& $font = $pdf\->ttfont(\*(Aq/fonts/Univers\-Bold.ttf\*(Aq); \& $font = $pdf\->ttfont(\*(Aq../Democratica\-SmallCaps.ttf\*(Aq); .Ve .RE .SS psfont .IX Subsection "psfont" .Vb 1 \& $font = $pdf\->psfont($ps_file, %options) \& \& $font = $pdf\->psfont($ps_file) .Ve .Sp .RS 4 Returns a new Type1 (PS) font object. .Sp \&\fBExamples:\fR .Sp .Vb 2 \& $font = $pdf\->psfont(\*(AqTimesRoman.pfa\*(Aq, \*(Aqafmfile\*(Aq => \*(AqTimesRoman.afm\*(Aq, \*(Aqencode\*(Aq => \*(Aqlatin1\*(Aq); \& $font = $pdf\->psfont(\*(Aq/fonts/Univers.pfb\*(Aq, \*(Aqpfmfile\*(Aq => \*(Aq/fonts/Univers.pfm\*(Aq, \*(Aqencode\*(Aq => \*(Aqlatin2\*(Aq); .Ve .RE .SS create_egs .IX Subsection "create_egs" .Vb 1 \& $egs = $pdf\->create_egs() .Ve .Sp .RS 4 Returns a new extended-graphics-state object. .Sp \&\fBExamples:\fR .Sp .Vb 1 \& $egs = $pdf\->create_egs(); .Ve .RE .SS image_jpeg .IX Subsection "image_jpeg" .Vb 1 \& $img = $pdf\->image_jpeg($file) .Ve .Sp .RS 4 Returns a new JPEG image object. .RE .SS image_png .IX Subsection "image_png" .Vb 1 \& $img = $pdf\->image_png($file) .Ve .Sp .RS 4 Returns a new PNG image object. .RE .SS image_tiff .IX Subsection "image_tiff" .Vb 1 \& $img = $pdf\->image_tiff($file, %opts) \& \& $img = $pdf\->image_tiff($file) .Ve .Sp .RS 4 Returns a new TIFF image object. .RE .SS image_pnm .IX Subsection "image_pnm" .Vb 1 \& $img = $pdf\->image_pnm($file) .Ve .Sp .RS 4 Returns a new PNM image object. .RE .SS savestate .IX Subsection "savestate" .Vb 1 \& $pdf\->savestate() .Ve .Sp .RS 4 Saves the state of the page. .RE .SS restorestate .IX Subsection "restorestate" .Vb 1 \& $pdf\->restorestate() .Ve .Sp .RS 4 Restores the state of the page. .RE .SS egstate .IX Subsection "egstate" .Vb 1 \& $pdf\->egstate($egs) .Ve .Sp .RS 4 Sets extended-graphics state. .RE .SS fillcolor .IX Subsection "fillcolor" .Vb 1 \& $pdf\->fillcolor($color) .Ve .Sp .RS 4 Sets the fill color. See \f(CW\*(C`strokecolor\*(C'\fR for color names and specifications. .RE .SS strokecolor .IX Subsection "strokecolor" .Vb 1 \& $pdf\->strokecolor($color) .Ve .Sp .RS 4 Sets the stroke color. .Sp \&\fBDefined color-names are:\fR .Sp .Vb 10 \& aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, \& blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, \& cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey, \& darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, \& darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, \& deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, \& fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, \& hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, \& lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightgrey, \& lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, \& lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, \& mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, \& mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, \& navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, \& paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, \& red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, \& silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, \& thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen .Ve .Sp or the rgb-hex-notation: .Sp .Vb 1 \& #rgb, #rrggbb, #rrrgggbbb and #rrrrggggbbbb .Ve .Sp or the cmyk-hex-notation: .Sp .Vb 1 \& %cmyk, %ccmmyykk, %cccmmmyyykkk and %ccccmmmmyyyykkkk .Ve .Sp or the hsl-hex-notation: .Sp .Vb 1 \& &hsl, &hhssll, &hhhssslll and &hhhhssssllll .Ve .Sp or the hsv-hex-notation: .Sp .Vb 1 \& !hsv, !hhssvv, !hhhsssvvv and !hhhhssssvvvv .Ve .RE .SS linedash .IX Subsection "linedash" .Vb 1 \& $pdf\->linedash(@dash) .Ve .Sp .RS 4 Sets the line dash pattern. .RE .SS linewidth .IX Subsection "linewidth" .Vb 1 \& $pdf\->linewidth($width) .Ve .Sp .RS 4 Sets the line width. .RE .SS transform .IX Subsection "transform" .Vb 1 \& $pdf\->transform(%opts) .Ve .Sp .RS 4 Sets transformations (i.e., translate, rotate, scale, skew) in PDF-canonical order. .Sp \&\fBExample:\fR .Sp .Vb 6 \& $pdf\->transform( \& \*(Aqtranslate\*(Aq => [$x,$y], \& \*(Aqrotate\*(Aq => $rot, \& \*(Aqscale\*(Aq => [$sx,$sy], \& \*(Aqskew\*(Aq => [$sa,$sb], \& ) .Ve .RE .SS move .IX Subsection "move" .Vb 1 \& $pdf\->move($x,$y) .Ve .Sp .RS 4 Move to a new drawing location at C[$x,$y]. .RE .SS line .IX Subsection "line" .Vb 1 \& $pdf\->line($x,$y) .Ve .Sp .RS 4 Draw a line to C[$x,$y]. .RE .SS curve .IX Subsection "curve" .Vb 1 \& $pdf\->curve($x1,$y1, $x2,$y2, $x3,$y3) .Ve .Sp .RS 4 Draw a Bezier curve with three control points. .RE .SS arc .IX Subsection "arc" .Vb 1 \& $pdf\->arc($xc,$yc, $rx,$ry, $alpha,$beta, $move, $dir) \& \& $pdf\->arc($xc,$yc, $rx,$ry, $alpha,$beta, $move) .Ve .Sp .RS 4 Draw an arc centered at C[$xc,$yc], with x radius C[$rx] and y radius C[$ry], from C[$alpha] degrees to C[$beta] degrees. If C[$move] is \fItrue\fR, do \fBnot\fR draw a line to the start of the arc. C[$dir] defaults to 0 for counter-clockwise sweep, and may be set to 1 for a clockwise sweep. .RE .SS ellipse .IX Subsection "ellipse" .Vb 1 \& $pdf\->ellipse($xc,$yc, $rx,$ry) .Ve .Sp .RS 4 Draw an ellipse centered at C[$xc,$yc], with x radius C[$rx] and y radius C[$ry]. .RE .SS circle .IX Subsection "circle" .Vb 1 \& $pdf\->circle($xc,$yc, $r) .Ve .Sp .RS 4 Draw a circle centered at C[$xc,$yc], of radius C[$r]. .RE .SS rect .IX Subsection "rect" .Vb 1 \& $pdf\->rect($x,$y, $w,$h) .Ve .Sp .RS 4 Draw a rectangle with lower left corner at C[$x,$y], width (+x) C[$w] and height (+y) C[$h]. .RE .SS rectxy .IX Subsection "rectxy" .Vb 1 \& $pdf\->rectxy($x1,$y1, $x2,$y2) .Ve .Sp .RS 4 Draw a rectangle with opposite corners C[$x1,$y1] and C[$x2,$y2]. .RE .SS poly .IX Subsection "poly" .Vb 1 \& $pdf\->poly($x1,$y1, ..., $xn,$yn) .Ve .Sp .RS 4 Draw a polyline (multiple line segments) starting at (\fImove\fR to) C[$x1,$y1] and continuing on to C[$x2,$y2], ..., C[$xn,$yn]. .RE .SS close .IX Subsection "close" .Vb 1 \& $pdf\->close() .Ve .Sp .RS 4 Close a shape (draw a line back to the beginning). .RE .SS stroke .IX Subsection "stroke" .Vb 1 \& $pdf\->stroke() .Ve .Sp .RS 4 Stroke (actually draw) a shape whose path has already been laid out, using the requested \f(CW\*(C`strokecolor\*(C'\fR. .RE .SS fill .IX Subsection "fill" .Vb 1 \& $pdf\->fill() .Ve .Sp .RS 4 Fill in a closed geometry (path), using the requested \f(CW\*(C`fillcolor\*(C'\fR. The \fInon-zero winding rule\fR is used if the path crosses itself. .RE .SS fillstroke .IX Subsection "fillstroke" .Vb 1 \& $pdf\->fillstroke() .Ve .Sp .RS 4 Fill (using \f(CW\*(C`fillcolor\*(C'\fR) \fIand\fR stroke (using \f(CW\*(C`strokecolor\*(C'\fR) a closed path. The \fInon-zero winding rule\fR is used if the path crosses itself. .RE .SS image .IX Subsection "image" .Vb 1 \& $pdf\->image($imgobj, $x,$y, $w,$h) \& \& $pdf\->image($imgobj, $x,$y, $scale) \& \& $pdf\->image($imgobj, $x,$y) .Ve .Sp .RS 4 \&\fBPlease Note:\fR The width/height or scale given is in user-space coordinates, which are subject to transformations which may have been specified beforehand. .Sp Per default this has a 72dpi resolution, so if you want an image to have a 150 or 300dpi resolution, you should specify a scale of 72/150 (or 72/300) or adjust width/height accordingly. .RE .SS textstart .IX Subsection "textstart" .Vb 1 \& $pdf\->textstart() .Ve .Sp .RS 4 Forces the start of text mode while in graphics. .RE .SS textfont .IX Subsection "textfont" .Vb 1 \& $pdf\->textfont($fontobj, $size) .Ve .Sp .RS 4 Define the current font to be an (already defined) font object at the given size. .RE .SS textleading .IX Subsection "textleading" .Vb 1 \& $txt\->textleading($leading) .Ve .Sp .RS 4 Set the baseline-to-baseline "leading" to be used for text lines. .RE .SS text .IX Subsection "text" .Vb 1 \& $pdf\->text($string) .Ve .Sp .RS 4 Applies (writes out) the given text at the current text location, using the already-specified font. .RE .SS nl .IX Subsection "nl" .Vb 1 \& $pdf\->nl() .Ve .Sp .RS 4 Write a newline (drop down to the next line). .RE .SS textend .IX Subsection "textend" .Vb 1 \& $pdf\->textend() .Ve .Sp .RS 4 Force an end to text output and return to graphics. .RE .SS print .IX Subsection "print" .Vb 1 \& $pdf\->print($font, $size, $x,$y, $rot, $just, $text) .Ve .Sp .RS 4 Convenience wrapper for shortening the textstart..textend sequence. .Sp Go into text mode, set the font to the object and size, go to the location, set any rotation, set justification, and write the array of text. Justification is 0 for left, 1 for center, and 2 for right. .RE .SH AUTHOR .IX Header "AUTHOR" This module was originally written by Alfred Reibenschuh. It has had some minor updates over time, but otherwise is mostly unchanged.