Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ps_set_info(3) [php man page]

PS_SET_INFO(3)								 1							    PS_SET_INFO(3)

ps_set_info - Sets information fields of document

SYNOPSIS
bool ps_set_info (resource $p, string $key, string $val) DESCRIPTION
Sets certain information fields of the document. This fields will be shown as a comment in the header of the PostScript file. If the docu- ment is converted to pdf this fields will also be used for the document information. The BoundingBox is usually set to the value given to the first page. This only works if ps_findfont(3) has not been called before. In such cases the BoundingBox would be left unset unless you set it explicitly with this function. This function will have no effect anymore when the header of the postscript file has been already written. It must be called before the first page or the first call of ps_findfont(3). PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $key - The name of the information field to set. The values which can be set are Keywords, Subject, Title, Creator, Author, Bounding- Box, and Orientation. Be aware that some of them has a meaning to PostScript viewers. o $value - The value of the information field. The field Orientation can be set to either Portrait or Landscape. The BoundingBox is a string consisting of four numbers. The first two numbers are the coordinates of the lower left corner of the page. The last two numbers are the coordinates of the upper right corner. Note Up to version 0.2.6 of pslib, the BoundingBox and Orientation will be overwritten by ps_begin_page(3), unless ps_findfont(3) has been called before. RETURN VALUES
Returns TRUE on success or FALSE on failure. SEE ALSO
ps_findfont(3), ps_begin_page(3). PHP Documentation Group PS_SET_INFO(3)

Check Out this Related Man Page

PS_ROTATE(3)								 1							      PS_ROTATE(3)

ps_rotate - Sets rotation factor

SYNOPSIS
bool ps_rotate (resource $psdoc, float $rot) DESCRIPTION
Sets the rotation of the coordinate system. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $rot - Angle of rotation in degree. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Rotation 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, "rotation.ps")) { print "Cannot open PostScript file "; exit; } ps_set_info($ps, "Creator", "rotation.php"); ps_set_info($ps, "Author", "Uwe Steinmann"); ps_set_info($ps, "Title", "Rotation 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_save($ps); ps_translate($ps, 100, 100); ps_rotate($ps, 45); rectangle($ps); ps_restore($ps); ps_setfont($ps, $psfont, 8.0); ps_show($ps, "Text without rotation"); ps_end_page($ps); ps_delete($ps); ?> The above example illustrates a very common way of rotating a graphic (in this case just a rectangle) by simply rotating the coor- dinate system. Since the graphic's coordinate system assumes (0,0) to be the origin, the page coordinate system is also translated to place the graphics not on the edge of the page. Pay attention to the order of ps_translate(3) and ps_rotate(3). In the above case the rectancle is rotated around the point (100, 100) in the untranslated coordinate system. Switching the two statements has a com- pletely different result. In order to output the following text at the original position, all modifications of the coordinate system are encapsulated in ps_save(3) and ps_restore(3). SEE ALSO
ps_scale(3), ps_translate(3). PHP Documentation Group PS_ROTATE(3)
Man Page