Name

Parameter array -- data for PDF objects

Description

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:
ParameterMeaningPossible ValuesDefaultApplies to
fontfont Courier, Courier-Bold, Courier-Oblique, Courier-BoldOblique, Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic, Symbol, ZapfDingbats Helveticaall text objects
heightfont heightPositive, nonzero values12all text objects
alignFont alignmentright, center, leftleftparagraph text objects
widthstroking widthPositive, nonzero values1rectangle, 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+strokefill for text, stroke for shapesall closed objects
rotationAngle to paint the objectall real numbers0text 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-1blackall objects
pagesizeSize of new pagespositive 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.

Notes

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.

Examples

Sets some parameters for placing text:

$p["height"] = 12;
$p["font"] = "Times-Roman";
$pdf->draw_text(10, 10, "Hello World", $page, $p);

See Also

History

The color system was changed in 2.1

Bugs