本文整理汇总了PHP中MYPDF::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:PHP MYPDF::SetFillColor方法的具体用法?PHP MYPDF::SetFillColor怎么用?PHP MYPDF::SetFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MYPDF
的用法示例。
在下文中一共展示了MYPDF::SetFillColor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
// header and footer
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
// set margins
$pdf->SetMargins(10, 30, 10);
$pdf->SetHeaderMargin(30);
$pdf->SetFooterMargin(10);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 15);
// set font
$pdf->SetFont('freesans', '', 12, '', true);
// add a page
$pdf->AddPage();
// page styles
$pdf->SetTextColor(0);
$pdf->SetFillColor(245);
$fill = FALSE;
// border
$border = '';
// header
$pdf->SetFont('freesans', '', 8, '', true);
$pdf->Cell(25, 3, mb_strtoupper(api_text("module-diary_export-sport"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(25, 3, mb_strtoupper(api_text("module-diary_export-sort"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(35, 3, mb_strtoupper(api_text("module-diary_export-time"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(25, 3, mb_strtoupper(api_text("module-diary_export-distance"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(130, 3, mb_strtoupper(api_text("module-diary_export-description"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(0, 3, mb_strtoupper(api_text("module-diary_export-datetraining"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Ln();
//Colora dettagli blu
$pdf->SetTextColor(0, 0, 255);
foreach ($trainings->results as $training) {
示例2: dirname
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of text layout using Multicell()', '', 0, 'L', true, 0, false, false, 0);
$pdf->Ln(5);
$pdf->SetFont('times', '', 9);
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
// set color for background
$pdf->SetFillColor(255, 255, 200);
$text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.';
// print some rows just as example
for ($i = 0; $i < 10; ++$i) {
$pdf->MultiRow('Row ' . ($i + 1), $text . "\n");
}
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_020.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
示例3: array
$pdf->SetFont('helvetica', '', 8);
//---------------------------------
$tbl = <<<EOD
<table border="1" cellpadding="0" cellspacing="1" align="center" fontsize="14">
<tr>
<td></td><td><br /><br /><br /><br /></td>
</tr>
<tr>
<th colspan="2"><h1>Estructura Programática</h1></th>
</tr>
</table>
EOD;
$pdf->writeHTML($tbl, true, false, false, false, '');
$pdf->Ln();
$pdf->SetLineStyle(array('width' => 0.0, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => array(255, 0, 0)));
$pdf->SetFillColor(255, 255, 128);
$pdf->SetTextColor(0, 0, 128);
$pdf->Ln();
$tbl = <<<EOD
<table border="1" cellpadding="1" cellspacing="1" align="center" fontsize="12">
<tr>
<th colspan="1">ID</th>
<th colspan="1">CLAVE</th>
<th colspan="1">DESCRIPCIÓN</th>
<th colspan="1">TIPO</th>
</tr>
</table>
EOD;
$pdf->writeHTML($tbl, true, false, false, false, '');
$pdf->Ln();
//<td>{$value['id']}</td>
示例4: foreach
$pdf->conference_name = $conference['name'];
//
// Setup the PDF basics
//
$pdf->SetCreator('Ciniki');
$pdf->SetAuthor($business_details['name']);
$pdf->SetTitle($conference['name']);
$pdf->SetSubject('');
$pdf->SetKeywords('');
// set margins
$pdf->SetMargins($pdf->left_margin, $pdf->top_margin + $pdf->header_height, $pdf->right_margin);
$pdf->SetHeaderMargin($pdf->top_margin);
// set font
$pdf->SetFont('times', 'BI', 10);
$pdf->SetCellPadding(2);
$pdf->SetFillColor(255);
$pdf->SetTextColor(0);
$pdf->SetDrawColor(51);
$pdf->SetLineWidth(0.15);
foreach ($presentations as $presentation) {
// add a page
$pdf->AddPage();
$pdf->SetFont('', 'B', 12);
$pdf->MultiCell(180, 1, $presentation['display_title'], 0, 'L');
$pdf->SetFont('', '', 11);
$pdf->MultiCell(180, 1, $presentation['field'], 0, 'L');
$pdf->SetFont('', '', 10);
$pdf->Ln();
$pdf->MultiCell(180, 8, $presentation['description'], 0, 'L');
}
return array('stat' => 'ok', 'presentations' => $presentations, 'conference' => $conference, 'pdf' => $pdf);
示例5: Footer
// $this->Cell(0, 15, 'Klassenliste der '.$_SESSION['myclass'], 0, 0, 'L', 0, '', 0, false, 'C', 'C');
// $this->Cell(0, 15, 'Datum: '.$_SESSION['datum'] , 0, 1, 'R', 0, '', 0, false, 'C', 'C');
}
// Page footer
public function Footer()
{
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
// $this->Cell(0, 10, 'Seite 1 von 2 ', 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
$pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetFillColor(150, 150, 150);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('von-Buelow-Gymnasium');
$pdf->SetTitle('Notenliste');
$pdf->SetSubject('');
$pdf->SetKeywords('');
$pdf->AddPage('P', 'A4');
$lfdnr = 0;
$dist = 0;
$pdf->setY(30);
while ($meineSchueler = mysql_fetch_assoc($meineSchueler_tmp)) {
$zeilenhoehe = $_GET['zeilenh'];
$lfdnr++;
$schueler_vorname = $meineSchueler['firstname'];
$schueler_nachname = $meineSchueler['lastname'];
示例6: Answer
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
// set font
$pdf->SetFont('freeserif', '', 16);
$txt = "\"" . $survey->getQuestion() . "\"";
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
$pdf->Ln(5);
// set cell padding
$pdf->setCellPaddings(1, 1, 1, 1);
// set cell margins
$pdf->setCellMargins(0, 0, 0, 0);
// set font
$pdf->SetFont('freeserif', 'B', 14);
$txt = 'Отговори';
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
// set color for background
$pdf->SetFillColor(225, 225, 225);
// set font
$pdf->SetFont('freeserif', '', 12);
// Multicell test
$txt = '№';
$pdf->MultiCell(10, '', $txt, 1, 'C', 1, 0, '', '', true);
$txt = 'Отговор';
$pdf->MultiCell(140, '', $txt, 1, 'C', 1, 0, '', '', true);
$txt = 'Тип';
$pdf->MultiCell(30, '', $txt, 1, 'C', 1, 1, '', '', true);
// set color for background
$pdf->SetFillColor(255, 255, 255);
$number_answer = 1;
foreach ($answers as $answer_id) {
$answer = new Answer();
$answer->get_from_db($answer_id);