PHP.nl

ps_set_text_pos

ps_set_text_pos

Sets position for text output

bool **ps_set_text_pos** resource $psdoc float $x float $y

Set the position for the next text output. You may alternatively set the x and y value separately by calling and choosing respectively as the value name. ps_set_value``textx``texty

If you want to output text at a certain position it is more convenient to use instead of setting the text position and calling . ps_show_xy``ps_show

psdoc Resource identifier of the postscript file as returned by . ps_new

xx-coordinate of the new text position.

yy-coordinate of the new text position.

return.success

Voorbeeld: Placing text at a given position

<?php
$ps = ps_new();
if (!ps_open_file($ps, "text.ps")) {
  print "Cannot open PostScript file\n";
  exit;
}

ps_set_info($ps, "Creator", "rectangle.php");
ps_set_info($ps, "Author", "Uwe Steinmann");
ps_set_info($ps, "Title", "Text placement example");

ps_begin_page($ps, 596, 842);
$psfont = ps_findfont($ps, "Helvetica", "", 0);
ps_setfont($ps, $psfont, 8.0);
ps_show_xy($ps, "Some text at (100, 100)", 100, 100);

ps_set_value($ps, "textx", 100);
ps_set_value($ps, "texty", 120);
ps_show($ps, "Some text at (100, 120)");
ps_end_page($ps);

ps_delete($ps);
?>

ps_set_value``ps_show