PS_SAVE(3) 1 PS_SAVE(3)ps_save - Save current contextSYNOPSIS
bool ps_save (resource $psdoc)
DESCRIPTION
Saves the current graphics context, containing colors, translation and rotation settings and some more. A saved context can be restored
with ps_restore(3).
PARAMETERS
o $psdoc
- Resource identifier of the postscript file as returned by ps_new(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
SEE ALSO ps_restore(3).
PHP Documentation Group PS_SAVE(3)
Check Out this Related Man Page
PS_TRANSLATE(3) 1 PS_TRANSLATE(3)ps_translate - Sets translationSYNOPSIS
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)
Dear All,
We have following code to send mails from unix to users. We want to see few sentences of mail in bold font or to hightlight few lines in different colours. Could you please let me know how can we do it in function construct_body.
... (3 Replies)
Good afternoon.
I am a newbie.
We just had a potentially big problem (negated to having good backups).
Basically, there is an option in SAM, to delete all the data from the system that a user ever created.
Lo and behold, silly me, I choose that option, and all sorts of needed files... (5 Replies)
Hi All,
Could you please help me in searching files in a better way satisfying the below conditions
I want to search files in a path whose access time is more than 5min and less than 60 min and whose Byte size is greater than zero
For this, i am using the below command, but it is... (2 Replies)
On my Solaris box I have to reboot some devices like below.
However I think this can be done through a script. I've create a list that contains the devices IP addresses.
Here's the logic:
Reboot 4 devices and sleep for 5mins(300s.) While the devices are rebooting, I would like to confirm... (9 Replies)
Hi Folks,
I have setup a passwordless connection from my Linux ( source) machine toSolaris ( destination ) machine. I have added passphrase while creating the rsa key. Now problem is each time when i make a connection i have to give the passphrase to make connection. How to override this ?
I... (4 Replies)
Hi All,
I want to read an excel file.
PFA excel, I want to read the cloumn from A to G and the V to AH
starting from Row number 3.
Please help me on this. (7 Replies)
Happy holidays everyone :)
I'm trying to increase usabilty for my scripted project-, for that i wanted to apply an error message poping up upon every and any error (other than proper exit) indicating the enduser a uniform, and hopefully readable error messsage.
To achieve this, i wrote a... (4 Replies)