本文整理汇总了PHP中FPDF::getY方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::getY方法的具体用法?PHP FPDF::getY怎么用?PHP FPDF::getY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::getY方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$amt = $row['amt'];
$account_type = $row['account_type'];
$linedesc = $row['linedesc'];
if ($account_type == 4) {
$paymentmethodtext = "Cheque :";
} else {
$paymentmethodtext = "Cash";
}
if ($m > 13) {
$m = 1;
$pdf->AddPage($pdf->CurOrientation);
}
$pdf->SetX($xmargin);
$pdf->Cell(10, 4, $i, 0, 0, 'C');
$currentx = $pdf->getX();
$currenty = $pdf->getY();
$pdf->Cell(120, 4, $subject, 0, 0, 'L');
if ($linedesc != "") {
$pdf->SetXY($currentx, $currenty + 5);
$pdf->MultiCell(0, 4, "{$linedesc}", "0", 'L');
//$pdf->Cell(40,4,$paymentmethodtext,0,0,'L');
$maxy = $pdf->getY();
} else {
$maxy = $pdf->getY() + 2;
}
$pdf->SetXY($currentx + 120, $currenty);
$pdf->Cell(0, 4, $amt, 0, 1, 'R');
}
//paymentvoucher AMT number in block (9)
$pdf->SetXY($xmargin, 120 + 5);
$pdf->SetFont("Times", "", 14);
示例2: GetaField
$pdf->SetFont('Courier', 'B', 14);
$pdf->Cell(55, 2, '', 0, 1);
$pdf->Cell(5, 10, '', 0, 0);
//$pdf->Cell(50,10,strtoupper($pmb[Nama]),0,1);
$pdf->MultiCell(50, 5, $pmb['Nama'], 0);
$pdf->Cell(55, 1, '', 0, 1);
$pdf->SetFont('Arial', '', 6);
$pdf->Cell(55, 4, 'NAMA', 0, 1);
$pdf->SetFont('Courier', 'B', 14);
$pdf->Cell(5, 10, '', 0, 0);
$pdf->Cell(50, 10, $ProdiNama['Nama'], 0, 1);
$pdf->SetFont('Arial', '', 6);
$pdf->Cell(55, 4, 'PROGRAM STUDI', 0, 1);
$ImagePath = GetaField('mhsw', "MhswID='{$pmb['MhswID']}' and KodeID", KodeID, "Foto");
if (empty($ImagePath)) {
$pdf->SetXY($pdf->getX() + 60, $pdf->getY() - 40);
$pdf->Cell(30, 40, 'FOTO', 1, 1, 'C');
} else {
$pdf->Image('../' . $ImagePath, $pdf->getX() + 60, $pdf->getY() - 40, 30, 40);
}
$pdf->SetFont('Arial', '', 7);
$pdf->SetXY(110, 10);
$pdf->Cell(90, 5, "* Kartu Mahasiswa ini wajib dibawa untuk setiap kegiatan PMB di Kampus", 0, 1);
$pdf->SetX(110);
$pdf->Cell(90, 5, "* Kartu Mahasiswa ini berlaku selama Mahasiswa aktif atau dalam masa", 0, 1);
$pdf->SetX(110);
$pdf->Cell(90, 5, " berlaku kartu", 0, 1);
$pdf->SetX(110);
$pdf->Cell(90, 5, "* Apabila kartu Mahasiswa ini hilang agar melapor ke Bag. Akademik dan", 0, 1);
$pdf->SetX(110);
$pdf->Cell(90, 5, " dikenai biaya pembuatan kartu sebesar Rp 100.000,-", 0, 1);
示例3: sprintf
$pdf->Cell(11, 5, utf8_decode(sprintf('%s %%', number_format($umsatz['mwst_satz'], 2, ',', ''))), 1, 0, 'R');
// Zeilenumbruch einfügen
$pdf->Ln();
}
// Zeilenumbrüche einfügen
$pdf->Ln();
$pdf->Ln();
// Schriftgrad einstellen
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(20, 6, utf8_decode('MwSt-Satz'), 0, 0, 'R');
$pdf->Cell(15, 6, utf8_decode('Flüge'), 0, 0, 'C');
$pdf->Cell(27, 6, utf8_decode('Ges.-Umsatz'), 0, 0, 'R');
// Zeilenumbruch einfügen
$pdf->Ln();
// vertikale Y-Position ermitteln
$y = $pdf->getY();
// Linienbreite einstellen, 0.2 mm
$pdf->SetLineWidth(0.2);
// Linie(n) zeichnen
$pdf->Line(25, $y, 90, $y);
// Schriftgrad einstellen
$pdf->SetFont('Arial', '', 10);
// Variable zur Aufsumierung der Umsätze anlegen
$umsatz_ges = 0.0;
foreach ($umsaetze['gesamtumsatz'] as $key => $val) {
$pdf->Cell(20, 6, sprintf('%s %%', number_format($key, 2, ',', '')), 0, 0, 'R');
$pdf->Cell(15, 6, $val['fluege'], 0, 0, 'C');
$pdf->Cell(27, 6, sprintf('%s EUR', number_format($val['summe'], 2, ',', '')), 0, 0, 'R');
// Umsatz aufsumieren
$umsatz_ges += $val['summe'];
// Zeilenumbruch einfügen
示例4: strformat
$pdf->SetFont($fonte, "b", 12);
$pdf->setx(5);
$pdf->ln();
$pdf->SetFont($fonte, "", 14);
$pdf->setx(5);
$pdf->cell(50, 5, "Controle de Entregas", 0, 1);
$pdf->line(5, $pdf->GetY(), 290, $pdf->GetY());
$pdf->ln(10);
$pdf->setfont($fonte, "B", "14");
$pdf->cell(0, 5, $_GET["dtvenda"], 0, 1, "C");
$pdf->setfillcolor(235);
$pdf->SetFont($fonte, "b", 10);
$total = $db->entregas["total"];
$sql = " SELECT fun_nome,count(*) as total\n FROM comandas inner join comandaentrega \n on cet_comid = com_id\n inner join funcionarios on fun_id = cet_funid\n WHERE com_dtcomanda = '" . strformat($_GET["dtvenda"], "dten") . "' group by fun_nome order by fun_nome";
$rs = $db->executa($sql);
$pdf->cell(140, 5, "Funcionário", "B", 0, "C", 1);
$pdf->cell(45, 5, "Qtde", "B", 1, "C", 1);
$pdf->SetFont($fonte, "", 10);
while ($ln = $db->fetch_array($rs)) {
if ($pdf->getY() >= $pdf->h - 15) {
$pdf->addpage();
$pdf->SetFont($fonte, "b", 10);
$pdf->cell(140, 5, "Funcionário", "B", 0, "C", 1);
$pdf->cell(45, 5, "Qtde", "B", 1, "C", 1);
$pdf->SetFont($fonte, "", 10);
}
$pdf->cell(140, 5, $ln["fun_nome"], 1, 0);
$pdf->cell(45, 5, $ln["total"], 1, 1);
}
$pdf->ln();
$pdf->output();
示例5: generatePDF
//.........这里部分代码省略.........
}
}
}
break;
}
}
}
if ($numberOfIcons == 0) {
// On ajoute l'icone neutre si aucune icone n'est présente
$pdf->Image(PLUGIN_PATH . '/css/img/neutral.png', $leftCornerX, $leftCornerY, floor(0.1 * $A4Height), 0, 'PNG');
}
// Deuxième ligne
$pdf->Ln(8 * $titleSize);
// On affiche le radar sur 1 an de données
$fullYearData = getEvaluationCCPCFullData($data['service']['id'], $promotion, $data['service']['date']['max'] - 31536000, $data['service']['date']['max'], FALSE);
// Récupération des données
// Titre
$pdf->Cell(floor(0.4 * $A4Height), $titleSize + 5, utf8_decode(LANG_FORM_CCPC_PDF_STAGEPERIODE_FULLYEAR . ' (' . date('d/m/Y', $fullYearData['service']['date']['min']) . ' ' . LANG_FORM_CCPC_PDF_STAGEPERIODE_END . ' ' . date('d/m/Y', $fullYearData['service']['date']['max']) . ')'), 0, 0, 'C', FALSE);
// On affiche l'image
// Liste des valeurs à afficher
$input = $form->xpath('categorie/input[@radarPDFGraph="1"]');
// Préparation des données
$tempData = array();
$tempData['settings'] = array('height' => 380, 'width' => 680, 'max' => 10);
foreach ($input as $theinput) {
// Récupération du parent
$categorie = $theinput->xpath('..')[0];
// Catégorie du graphique
if (isset($data[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'])) {
$tempData['data'][constant($theinput['label'] . '_SHORT')] = $fullYearData[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'] + 5;
}
}
// Affichage de l'image
$pdf->Image(eval_ccpc_genGraphRadar($tempData), 10, $pdf->getY() + 40, floor(0.4 * $A4Height), 0, 'PNG');
// On affiche le radar sur la période du stage
// On décale du 0.05*largeur
$pdf->Cell(floor(0.05 * $A4Height));
// On crée un rectangle contenant les données
$pdf->Rect($pdf->getX(), $pdf->getY() - 10, 0.5 * $A4Height, 0.3 * $A4Height, 'F');
// Titre
$pdf->Cell(floor(0.5 * $A4Height), $titleSize + 5, utf8_decode(LANG_FORM_CCPC_PDF_STAGEPERIODE_START . ' ' . date('d/m/Y', $data['service']['date']['min']) . ' ' . LANG_FORM_CCPC_PDF_STAGEPERIODE_END . ' ' . date('d/m/Y', $data['service']['date']['max'])), 0, 0, 'C', FALSE);
// On ajoute l'image
// Liste des valeurs à afficher
$input = $form->xpath('categorie/input[@radarPDFGraph="1"]');
// Préparation des données
$tempData = array();
$tempData['settings'] = array('height' => 380, 'width' => 650, 'max' => 10);
foreach ($input as $theinput) {
// Récupération du parent
$categorie = $theinput->xpath('..')[0];
// Catégorie du graphique
if (isset($data[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'])) {
$tempData['data'][constant($theinput['label'] . '_SHORT')] = $data[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'] + 5;
}
}
// Affichage de l'image
$pdf->Image(eval_ccpc_genGraphRadar($tempData), $pdf->getX() - 0.45 * $A4Height, $pdf->getY() + 40, floor(0.4 * $A4Height), 0, 'PNG');
// Affiche du logo
$pdf->Image(ROOT . 'theme/img/logo.png', 10, $A4Width - 100, 0, 50, 'PNG');
// Pied de Page
$pdf->SetX(0.5 * $A4Height);
$pdf->SetY($A4Width - 40);
$textSize = 10;
$pdf->SetFont('Arial', 'I', $textSize);
// Ligne de demarcation
$pdf->Line(15, $pdf->getY(), $A4Height - 15, $pdf->getY());
示例6: generatePDF
//.........这里部分代码省略.........
}
// On affiche l'icone des filtres
$filtres = eval_ccpc_checkFilterExistence($data['service']['id'], $data['service']['date']['min'], $data['service']['date']['max'], $promotion);
if (is_array($filtres)) {
foreach ($filtres as $filtre) {
if (isset($filtre['icone'])) {
$pdf->Image($filtre['icone'], 0.8 * $A4Height, 3 * $titleSize, floor(0.2 * $A4Height), 0, 'PNG');
break;
}
}
}
// Deuxième ligne
$pdf->Ln(8 * $titleSize);
// On affiche le radar sur 1 an de données
$fullYearData = getEvaluationCCPCFullData($data['service']['id'], $promotion, $data['service']['date']['max'] - 31536000, $data['service']['date']['max'], FALSE);
// Récupération des données
// Titre
$pdf->Cell(floor(0.4 * $A4Height), $titleSize + 5, utf8_decode(LANG_FORM_CCPC_PDF_STAGEPERIODE_FULLYEAR . ' (' . date('d/m/Y', $fullYearData['service']['date']['min']) . ' ' . LANG_FORM_CCPC_PDF_STAGEPERIODE_END . ' ' . date('d/m/Y', $fullYearData['service']['date']['max']) . ')'), 0, 0, 'C', FALSE);
// On affiche l'image
// Liste des valeurs à afficher
$input = $form->xpath('categorie/input[@radarPDFGraph="1"]');
// Préparation des données
$tempData = array();
$tempData['settings'] = array('height' => 380, 'width' => 680, 'max' => 10);
foreach ($input as $theinput) {
// Récupération du parent
$categorie = $theinput->xpath('..')[0];
// Catégorie du graphique
if (isset($data[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'])) {
$tempData['data'][constant($theinput['label'] . '_SHORT')] = $fullYearData[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'] + 5;
}
}
// Affichage de l'image
$pdf->Image(eval_ccpc_genGraphRadar($tempData), 10, $pdf->getY() + 40, floor(0.4 * $A4Height), 0, 'PNG');
// On affiche le radar sur la période du stage
// On décale du 0.05*largeur
$pdf->Cell(floor(0.05 * $A4Height));
// On crée un rectangle contenant les données
$pdf->Rect($pdf->getX(), $pdf->getY() - 10, 0.5 * $A4Height, 0.3 * $A4Height, 'F');
// Titre
$pdf->Cell(floor(0.5 * $A4Height), $titleSize + 5, utf8_decode(LANG_FORM_CCPC_PDF_STAGEPERIODE_START . ' ' . date('d/m/Y', $data['service']['date']['min']) . ' ' . LANG_FORM_CCPC_PDF_STAGEPERIODE_END . ' ' . date('d/m/Y', $data['service']['date']['max'])), 0, 0, 'C', FALSE);
// On ajoute l'image
// Liste des valeurs à afficher
$input = $form->xpath('categorie/input[@radarPDFGraph="1"]');
// Préparation des données
$tempData = array();
$tempData['settings'] = array('height' => 380, 'width' => 650, 'max' => 10);
foreach ($input as $theinput) {
// Récupération du parent
$categorie = $theinput->xpath('..')[0];
// Catégorie du graphique
if (isset($data[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'])) {
$tempData['data'][constant($theinput['label'] . '_SHORT')] = $data[(string) $categorie['nom']][(string) $theinput['nomBDD']]['moyenne'] + 5;
}
}
// Affichage de l'image
$pdf->Image(eval_ccpc_genGraphRadar($tempData), $pdf->getX() - 0.45 * $A4Height, $pdf->getY() + 40, floor(0.4 * $A4Height), 0, 'PNG');
// Affiche du logo
$pdf->Image(ROOT . 'theme/img/logo.png', 10, $A4Width - 100, 0, 50, 'PNG');
// Pied de Page
$pdf->SetX(0.5 * $A4Height);
$pdf->SetY($A4Width - 40);
$textSize = 10;
$pdf->SetFont('Arial', 'I', $textSize);
// Ligne de demarcation
$pdf->Line(15, $pdf->getY(), $A4Height - 15, $pdf->getY());
示例7: print_pdf_header
/**
* Add relevant header info to the pdf output
*
* @param FPDF $newpdf The report pdf we are creating
*/
public function print_pdf_header($newpdf)
{
global $CFG;
//initial y position
$initial_y = $newpdf->getY();
//determine page with, not including margins
$effective_page_width = $newpdf->w - $newpdf->lMargin - $newpdf->rMargin;
//store the original font size
$old_font_size = $newpdf->FontSizePt;
//use a large font size for the header info
$newpdf->setFontSize(12);
//used to track vertical positioning
$i = 0;
//render any appropriate text for each header
if ($header_info = $this->get_gas_gauge_header_info()) {
foreach ($header_info as $header_entry) {
//render across
$newpdf->Cell($effective_page_width, 0, $header_entry, 0, 0, 'C');
//draw a line below the text
$line_top = $initial_y + 0.2 * $i + 0.1;
$newpdf->Line($newpdf->lMargin, $line_top, $newpdf->lMargin + $effective_page_width, $line_top);
//add necessary spacing
$newpdf->Ln(0.2);
$i++;
}
}
//if the max value is not zero, render the gas gauge
if ($this->gas_gauge_max_value != 0) {
//retrieve the color palette as defined by the report
$palette = $this->get_gas_gauge_color_palette();
//approximate pixels using points
$actual_radius = PHP_REPORT_GAS_GAUGE_MAXIMUM_WIDTH / 2 / 72;
//set up the variables needed by the gas-gauge-generating script
//current value on the gas gauge
$passthru_value = $this->gas_gauge_value;
//maximum value on the gauge
$passthru_total = $this->gas_gauge_max_value;
//radius of the gas gauge
$passthru_radius = PHP_REPORT_GAS_GAUGE_MAXIMUM_WIDTH;
//colour palette to use (also specifies number of sections)
$passthru_palette = $palette;
//indicate that we are persisting the image
$passthru_persist = 1;
//filename to save the image to
$passthru_filename = tempnam($CFG->dataroot . '/temp', 'gas_gauge_');
//generate the necessary image file
$gas_gauge_url = $CFG->dirroot . '/blocks/php_report/gas_gauge_output.php';
require_once $gas_gauge_url;
//leftmost position of the gas gauge
$left_position = $newpdf->w / 2 - $actual_radius;
//vertical offset, based on number of headers
$top_position = $initial_y + 0.2 * count($header_info) + 0.1;
//draw the gas gauge and add appropriate vertical space
$newpdf->Image($passthru_filename, $left_position, $top_position, 2 * $actual_radius, $actual_radius, 'png');
$newpdf->Ln($actual_radius + 0.2);
//delete the temporary image file
unlink($passthru_filename);
}
//revert the font size to its initial value
$newpdf->setFontSize($old_font_size);
}