Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ps_makespotcolor(3) [php man page]

PS_MAKESPOTCOLOR(3)							 1						       PS_MAKESPOTCOLOR(3)

ps_makespotcolor - Create spot color

SYNOPSIS
int ps_makespotcolor (resource $psdoc, string $name, [int $reserved]) DESCRIPTION
Creates a spot color from the current fill color. The fill color must be defined in rgb, cmyk or gray colorspace. The spot color name can be an arbitrary name. A spot color can be set as any color with ps_setcolor(3). When the document is not printed but displayed by an post- script viewer the given color in the specified color space is use. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $name - Name of the spot color, e.g. Pantone 5565. RETURN VALUES
The id of the new spot color or 0 in case of an error. EXAMPLES
Example #1 Creating and using a spot color <?php $ps = ps_new(); if (!ps_open_file($ps, "spotcolor.ps")) { print "Cannot open PostScript file "; exit; } ps_set_info($ps, "Creator", "spotcolor.php"); ps_set_info($ps, "Author", "Uwe Steinmann"); ps_set_info($ps, "Title", "Spot color example"); ps_begin_page($ps, 596, 842); ps_setcolor($ps, "fill", "cmyk", 0.37, 0.0, 0.34, 0.34); $spotcolor = ps_makespotcolor($ps, "PANTONE 5565 C", 0); ps_setcolor($ps, "fill", "spot", $spotcolor, 0.5, 0.0, 0.0); ps_moveto($ps, 100, 100); ps_lineto($ps, 100, 200); ps_lineto($ps, 200, 200); ps_lineto($ps, 200, 100); ps_lineto($ps, 100, 100); ps_fill($ps); ps_end_page($ps); ps_delete($ps); ?> This example creates the spot color "PANTONE 5565 C" which is a darker green (olive) and fills a rectangle with 50% intensity. SEE ALSO
ps_setcolor(3). PHP Documentation Group PS_MAKESPOTCOLOR(3)

Check Out this Related Man Page

PS_TRANSLATE(3) 							 1							   PS_TRANSLATE(3)

ps_translate - Sets translation

SYNOPSIS
bool ps_translate (resource $psdoc, float $x, float $y) DESCRIPTION
Sets a new initial point of the coordinate system. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $x - x-coordinate of the origin of the translated coordinate system. o $y - y-coordinate of the origin of the translated coordinate system. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Translation of the coordinate system <?php function rectangle($ps) { ps_moveto($ps, 0, 0); ps_lineto($ps, 0, 50); ps_lineto($ps, 50, 50); ps_lineto($ps, 50, 0); ps_lineto($ps, 0, 0); ps_stroke($ps); } $ps = ps_new(); if (!ps_open_file($ps, "translate.ps")) { print "Cannot open PostScript file "; exit; } ps_set_info($ps, "Creator", "translate.php"); ps_set_info($ps, "Author", "Uwe Steinmann"); ps_set_info($ps, "Title", "Translated example"); ps_set_info($ps, "BoundingBox", "0 0 596 842"); $psfont = ps_findfont($ps, "Helvetica", "", 0); ps_begin_page($ps, 596, 842); ps_set_text_pos($ps, 100, 100); ps_translate($ps, 500, 750); rectangle($ps); ps_translate($ps, -500, -750); ps_setfont($ps, $psfont, 8.0); ps_show($ps, "Text at initial position"); ps_end_page($ps); ps_begin_page($ps, 596, 842); ps_set_text_pos($ps, 100, 100); ps_save($ps); ps_translate($ps, 500, 750); rectangle($ps); ps_restore($ps); ps_setfont($ps, $psfont, 8.0); ps_show($ps, "Text at initial position"); ps_end_page($ps); ps_delete($ps); ?> The above example demonstrates two possible ways to place a graphic (in this case just a rectangle) at any position on the page, while the graphic itself uses its own coordinate system. The trick is to change the origin of the current coordinate system before drawing the rectangle. The translation has to be undone after the graphic has been drawn. On the second page a slightly different and more elegant approach is applied. Instead of undoing the translation with a second call of ps_translate(3) the graphics context is saved before modifying the coordinate system and restored after drawing the rectangle. SEE ALSO
ps_scale(3), ps_rotate(3). PHP Documentation Group PS_TRANSLATE(3)
Man Page