note 31013 deleted from ref.cpdf by philip

From: Date: Fri, 18 Apr 2008 05:02:22 +0000
Subject: note 31013 deleted from ref.cpdf by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-138442@lists.php.net to get a copy of this message
Note Submitter: puterasalji at yahoo dot com ---- I've finally found a way to display text <?php $radius = 200; $margin = 20; $pagecount = 1; $pdf = cpdf_open(0); cpdf_page_init($pdf, $pagecount+1, 0, 2 * ($radius + $margin), 2 * ($radius + $margin), 1.0); cpdf_translate($pdf, $radius + $margin, $radius + $margin); cpdf_begin_text($pdf); cpdf_set_font($pdf, "Arial", 30, "NULL"); cpdf_set_text_rendering($pdf, 1); cpdf_text($pdf, "Yahoo!!", -198, 50); cpdf_end_text($pdf); /* minute strokes*/ for ($alpha = 0; $alpha < 90; $alpha += 6) { cpdf_setrgbcolor($pdf,9.0,9.0,0.0); cpdf_rotate($pdf, 6.0); cpdf_moveto($pdf, $radius, 0.0); cpdf_lineto($pdf, $radius-$margin/3, 0.0); cpdf_stroke($pdf); } cpdf_finalize($pdf); Header("Content-type: application/pdf"); cpdf_output_buffer($pdf); cpdf_close($pdf); ?> I'm not sure why, but the text appeared only after I've pasted the minute strokes draw function from clock.php example. I user the cpdf_translate to begin the x,y coordinate in the middle of the document

« previous php.notes (#138442) next »