Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ps_begin_pattern(3) [php man page]

PS_BEGIN_PATTERN(3)							 1						       PS_BEGIN_PATTERN(3)

ps_begin_pattern - Start a new pattern

SYNOPSIS
int ps_begin_pattern (resource $psdoc, float $width, float $height, float $xstep, float $ystep, int $painttype) DESCRIPTION
Starts a new pattern. A pattern is like a page containing e.g. a drawing which can be used for filling areas. It is used like a color by calling ps_setcolor(3) and setting the color space to pattern. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $width - The width of the pattern in pixel. o $height - The height of the pattern in pixel. o $x-step - The distance in pixel of placements of the pattern in horizontal direction. o $y-step - The distance in pixel of placements of the pattern in vertical direction. o $painttype - Must be 1 or 2. RETURN VALUES
The identifier of the pattern or FALSE on failure. EXAMPLES
Example #1 Creating and using a pattern <?php $ps = ps_new(); if (!ps_open_file($ps, "pattern.ps")) { print "Cannot open PostScript file "; exit; } ps_set_parameter($ps, "warning", "true"); ps_set_info($ps, "Creator", "pattern.php"); ps_set_info($ps, "Author", "Uwe Steinmann"); ps_set_info($ps, "Title", "Pattern example"); $pspattern = ps_begin_pattern($ps, 10.0, 10.0, 10.0, 10.0, 1); ps_setlinewidth($ps, 0.2); ps_setcolor($ps, "stroke", "rgb", 0.0, 0.0, 1.0, 0.0); ps_moveto($ps, 0, 0); ps_lineto($ps, 7, 7); ps_stroke($ps); ps_moveto($ps, 0, 7); ps_lineto($ps, 7, 0); ps_stroke($ps); ps_end_pattern($ps); ps_begin_page($ps, 596, 842); ps_setcolor($ps, "both", "pattern", $pspattern, 0.0, 0.0, 0.0); ps_rect($ps, 50, 400, 200, 200); ps_fill($ps); ps_end_page($ps); ps_close($ps); ps_delete($ps); ?> SEE ALSO
ps_end_pattern(3), ps_setcolor(3), ps_shading_pattern(3). PHP Documentation Group PS_BEGIN_PATTERN(3)

Check Out this Related Man Page

PS_BEGIN_PAGE(3)							 1							  PS_BEGIN_PAGE(3)

ps_begin_page - Start a new page

SYNOPSIS
bool ps_begin_page (resource $psdoc, float $width, float $height) DESCRIPTION
Starts a new page. Although the parameters $width and $height imply a different page size for each page, this is not possible in Post- Script. The first call of ps_begin_page(3) will set the page size for the whole document. Consecutive calls will have no effect, except for creating a new page. The situation is different if you intent to convert the PostScript document into PDF. This function places pdfmarks into the document which can set the size for each page indiviually. The resulting PDF document will have different page sizes. Though PostScript does not know different page sizes, pslib places a bounding box for each page into the document. This size is evaluated by some PostScript viewers and will have precedence over the BoundingBox in the Header of the document. This can lead to unexpected results when you set a BoundingBox whose lower left corner is not (0, 0), because the bounding box of the page will always have a lower left corner (0, 0) and overwrites the global setting. Each page is encapsulated into save/restore. This means, that most of the settings made on one page will not be retained on the next page. If there is up to the first call of ps_begin_page(3) no call of ps_findfont(3), then the header of the PostScript document will be output and the bounding box will be set to the size of the first page. The lower left corner of the bounding box is set to (0, 0). If ps_find- font(3) was called before, then the header has been output already, and the document will not have a valid bounding box. In order to pre- vent this, one should call ps_set_info(3) to set the info field BoundingBox and possibly Orientation before any ps_findfont(3) or ps_begin_page(3) calls. Note Up to version 0.2.6 of pslib, this function will always overwrite the BoundingBox and Orientation, if it has been set before with ps_set_info(3) and ps_findfont(3) has not been called before. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $width - The width of the page in pixel, e.g. 596 for A4 format. o $height - The height of the page in pixel, e.g. 842 for A4 format. RETURN VALUES
Returns TRUE on success or FALSE on failure. SEE ALSO
ps_end_page(3), ps_findfont(3), ps_set_info(3). PHP Documentation Group PS_BEGIN_PAGE(3)
Man Page