note 40665 deleted from function.pdf-rect by victor

From: Date: Tue, 23 Mar 2004 20:02:20 +0000
Subject: note 40665 deleted from function.pdf-rect by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-67073@lists.php.net to get a copy of this message
Note Submitter: Juan Carlos Alvez ---- To draw a Filled Rectangle, with coordinates in millimeters I use this function: function rectangulo($pdf,$x1,$y1,$x2,$y2) { global $alto; pdf_setcolor($pdf, "fill", "rgb", 0.9, 0.9, 0.9); pdf_setcolor($pdf, "stroke", "rgb", 0, 0, 0); pdf_moveto($pdf, $x1*2.83502, $alto-$y1*2.83502); pdf_lineto($pdf, $x2*2.83502, $alto-$y1*2.83502); pdf_lineto($pdf, $x2*2.83502, $alto-$y2*2.83502); pdf_lineto($pdf, $x1*2.83502, $alto-$y2*2.83502); pdf_lineto($pdf, $x1*2.83502, $alto-$y1*2.83502); pdf_fill_stroke($pdf); } Where $alto is the height of the Page (842 for A4), I need this because PDF uses coordinates bottom to top, and I like top to bottom.

« previous php.notes (#67073) next »