PHP Classes

Clip Rectangle Function

Recommend this page to a friend!

      classPdf  >  All threads  >  Clip Rectangle Function  >  (Un) Subscribe thread alerts  
Subject:Clip Rectangle Function
Summary:clipping function for class.pdf.php
Messages:1
Author:Thomas K
Date:2007-03-05 10:50:41
 

  1. Clip Rectangle Function   Reply   Report abuse  
Picture of Thomas K Thomas K - 2007-03-05 10:50:42
I have added this clipping function to the class. Hope its useful.

/**
* set up a rectangular clip path (no drawing will occur outside), note that it is the width and height of the rectangle which are the secondary paramaters, not
* the coordinates of the upper-right corner
*/
function clipRectangle($x1,$y1,$width,$height){
$this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re W';
}