note 69612 added to function.pdf-setdash

From: Date: Tue, 12 Sep 2006 18:18:43 +0000
Subject: note 69612 added to function.pdf-setdash
Groups: php.notes 
Request: Send a blank email to php-notes+get-117074@lists.php.net to get a copy of this message
Here is how I added a dashed line to my pdf. I couldn't find any info on this, so I decided to write what I learned from trial and error. On a page that is 612px wide and signified by $p, I drew a dashed line from left to right. $p = pdf_new(); pdf_begin_document($p,"",""); pdf_begin_page_ext($p,612,792,""); pdf_setdash($p,3,7); //3,7 can be any set of numbers pdf_save($p); //This saves what already there pdf_moveto($p,0,700); //move the pointer here pdf_lineto($p,612,700); //draw a line pdf_closepath_stroke($p); //show the line pdf_restore($p); //put it all back pdf_end_page_ext($p,""); pdf_end_document($p,""); $buf = pdf_get_buffer($p); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=hello.pdf"); print $buf; ---- Server IP: 216.194.113.175 Probable Submitter: 69.43.13.100 ---- Manual Page -- http://www.php.net/manual/en/function.pdf-setdash.php Edit -- https://master.php.net/note/edit/69612 Del: integrated -- https://master.php.net/note/delete/69612/integrated Del: useless -- https://master.php.net/note/delete/69612/useless Del: bad code -- https://master.php.net/note/delete/69612/bad+code Del: spam -- https://master.php.net/note/delete/69612/spam Del: non-english -- https://master.php.net/note/delete/69612/non-english Del: in docs -- https://master.php.net/note/delete/69612/in+docs Del: other reasons-- https://master.php.net/note/delete/69612 Reject -- https://master.php.net/note/reject/69612 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117074) next »