/** * Set the PDF fill style * * @param mixed $fillStyle The fillstyle to return, false if the one * explicitly set * @return bool True if set (so that a line should be drawn) * @access private */ function _setFillStyle($fillStyle = false) { if ($fillStyle === false) { $fillStyle = $this->_fillStyle; } if ($fillStyle == 'transparent' || $fillStyle === false) { return false; } $color = $this->_color($fillStyle); if ($this->_pdflib < 4) { pdf_setrgbcolor_fill($this->_pdf, $color[0] / 255, $color[1] / 255, $color[2] / 255); } else { pdf_setcolor($this->_pdf, 'fill', 'rgb', $color[0], $color[1], $color[2], 0); } return true; }
pdf_moveto($pdf, 660, 150); pdf_lineto($pdf, 680, 49); pdf_lineto($pdf, 695, 69); pdf_lineto($pdf, 716, 55); pdf_lineto($pdf, 696, 150); pdf_closepath($pdf); pdf_fill($pdf); // outline ribbon 2 pdf_moveto($pdf, 660, 150); pdf_lineto($pdf, 680, 49); pdf_lineto($pdf, 695, 69); pdf_lineto($pdf, 716, 55); pdf_lineto($pdf, 696, 150); pdf_closepath($pdf); pdf_stroke($pdf); pdf_setrgbcolor_fill($pdf, 0.8, 0, 0); //red //draw rosette draw_star(665, 175, 32, 57, 10, $pdf, true); //outline rosette draw_star(665, 175, 32, 57, 10, $pdf, false); // finish up the page and prepare to output pdf_end_page($pdf); pdf_close($pdf); $data = pdf_get_buffer($pdf); // generate the headers to help a browser choose the correct application header('Content-type: application/pdf'); header('Content-disposition: inline; filename=test.pdf'); header('Content-length: ' . strlen($data)); // output PDF echo $data;