Parameter array -- data for PDF objects
The parameters array is used by many PDF objects to define many facets of their placement and appearance. The values that are applicable differ for each type of PDF object. See the documentation for a particular PDF object to find out what parameters are applicable. Inapplicable parameters are ignored. Undefined parameters are set to reasonable defaults.
Any one of the parameters shown here can also be set using the set_default() function, and it will become the default value for all subsequent operations.
The complete list of parameters:Parameter | Meaning | Possible Values | Default | Applies to |
---|---|---|---|---|
font | font | Courier, Courier-Bold, Courier-Oblique, Courier-BoldOblique, Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic, Symbol, ZapfDingbats | Helvetica | all text objects |
height | font height | Positive, nonzero values | 12 | all text objects |
align | Font alignment | right, center, left | left | paragraph text objects |
width | stroking width | Positive, nonzero values | 1 | rectangle, line, circle |
mode smode tmode | The method of painting the object mode can be used to set both the text and shape mode in one step | fill, stroke, fill+stroke | fill for text, stroke for shapes | all closed objects |
rotation | Angle to paint the object | all real numbers | 0 | text objects |
color fillcolor strokecolor | Components of the painting color If the stroking or fill color is not specified, this value for color is used for both | an array of red, green, and blue values from 0-1 | black | all objects |
pagesize | Size of new pages | positive numbers and symbolic names (see new_page()) | letter | this parameter is only applicable to new_page(), however functions that automatically create new pages as need will use this value as set by set_default() |
margin margin-top margin-bottom margin-left margin-right |
Margins used to adjust placement of object on page margin sets all four margins in a single step. |
positive numbers | 72 | The value of these parameters is used to adapt the placement of objects to simulate page margins. |
color, fillcolor, and strokecolor must be specified as an array of red, blue, and green values. For example:
$param['fillcolor']['red'] = 1; $param['fillcolor']['blue'] = 0.5; $param['fillcolor']['green'] = 0;
See the get_color() command for an easier way to do this.
Sets some parameters for placing text:
$p["height"] = 12; $p["font"] = "Times-Roman"; $pdf->draw_text(10, 10, "Hello World", $page, $p);
The color system was changed in 2.1