Example #1
0
PDF_moveto($p, -$RADIUS / 10, -$RADIUS / 20);
PDF_lineto($p, $RADIUS * 0.8, 0.0);
PDF_lineto($p, -$RADIUS / 10, $RADIUS / 20);
PDF_closepath($p);
PDF_fill($p);
PDF_restore($p);
/* draw second hand */
PDF_setcolor($p, "fillstroke", "rgb", 1.0, 0.0, 0.0, 0.0);
PDF_setlinewidth($p, 2);
PDF_save($p);
PDF_rotate($p, -(($ltime['seconds'] - 15.0) * 6.0));
PDF_moveto($p, -$RADIUS / 5, 0.0);
PDF_lineto($p, $RADIUS, 0.0);
PDF_stroke($p);
PDF_restore($p);
/* draw little circle at center */
PDF_circle($p, 0, 0, $RADIUS / 30);
PDF_fill($p);
PDF_restore($p);
PDF_end_page($p);
/* close page           */
PDF_close($p);
/* close PDF document	*/
$buf = PDF_get_buffer($p);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: {$len}");
header("Content-Disposition: inline; filename=pdfclock.pdf");
print $buf;
PDF_delete($p);
/* delete the PDFlib object */
Example #2
0
 function writeFrameRect($x, $y, $width, $height, $rgb, $frgb)
 {
     $this->openPage();
     list($pdf_x, $pdf_y) = $this->posTopDown($x, $y);
     $this->setColor($frgb);
     PDF_rect($this->pdf, $pdf_x, $pdf_y, $width, -$height);
     PDF_fill($this->pdf);
     $this->setColor($rgb);
     PDF_rect($this->pdf, $pdf_x + 1, $pdf_y - 1, $width - 2, -$height + 2);
     PDF_fill($this->pdf);
 }