<?php $pdf = new MYPDF(); //$pdf->setMargins(20,20,20); $pdf->AliasNbPages(); $pdf->AddPage('L', 'A4'); $pdf->AddFont('PT_Serif-Web-Bold', '', 'PT_Serif-Web-Bold.php'); $pdf->SetFont('PT_Serif-Web-Bold', '', 32); $pdf->image('./images/lippo.jpg', 25, 4, 50, 30); $pdf->Text(290 / 2 - $pdf->GetStringWidth('Lumiere Club') / 2, 15, 'Lumiere Club'); $pdf->SetFont('PT_Serif-Web-Bold', '', 30); $pdf->Text(290 / 2 - $pdf->GetStringWidth('Lippo Mall Kemang') / 2, 26, 'Lippo Mall Kemang'); $pdf->SetFont('Times', '', 12); $pdf->Text(290 / 2 - $pdf->GetStringWidth('Jl. Pangeran Antasari 36 Jakarta Selatan - 12150') / 2, 33, 'Jl. Pangeran Antasari 36 Jakarta Selatan - 12150'); //$pdf->setDrawColor(105,102,102); $pdf->Line(10, 36, 290 - 5, 36); $pdf->SetFont('Arial', '', 22); $pdf->Text(290 / 2 - $pdf->GetStringWidth('Report Data Upgrade Membership') / 2, 45, 'Report Data Upgrade Membership'); $awal = date('d F Y', strtotime($tgl1)); $akhir = date('d F Y', strtotime($tgl2)); $periode = "{$awal} to {$akhir}"; $pdf->SetFont('Arial', '', 14); $pdf->Text(290 / 2 - $pdf->GetStringWidth($periode) / 2, 54, $periode); //$pdf->Line(10, 10, 210-10, 10); $pdf->SetXY(10, 60); $pdf->SetFont('Helvetica', '', 12); $content = UpgradeMembership::model()->with(array('member', 'user'))->findAll(array('condition' => 'upgrade_date BETWEEN :date1 AND :date2', 'params' => array(':date1' => $tgl1, ':date2' => $tgl2))); if ($content == null) { $pdf->SetFont('Helvetica', '', 48); $pdf->Text(290 / 2 - $pdf->GetStringWidth("No Data Found") / 2, 84, "No Data Found"); $pdf->Output();
if ($csf[$ff]['value_filter'] != "") { eval($csf[$ff]['value_filter']); } else { if (file_exists($plugin)) { include $plugin; } } $value = TidyList($value); $pdf->Cell($imagesize, ($refnumberfontsize + $leading) / 72, $value, 0, 2, 'L', 0, '', 1); } $bottomy = $pdf->GetY(); $bottomx = $pdf->GetX(); } else { if ($sheetstyle == "list") { $pdf->SetXY($currentx, $currenty); $pdf->Text($pdf->GetX() + $imagesize + 0.1, $pdf->GetY() + 0.2, $ref); $pdf->SetXY($currentx, $currenty); for ($ff = 0; $ff < count($config_sheetlist_fields); $ff++) { $value = ""; $value = str_replace("'", "\\'", $result[$n]['field' . $config_sheetlist_fields[$ff]]); $plugin = "../../plugins/value_filter_" . $csf[$ff]['name'] . ".php"; if ($csf[$ff]['value_filter'] != "") { eval($csf[$ff]['value_filter']); } else { if (file_exists($plugin)) { include $plugin; } } $value = TidyList($value); $pdf->Text($pdf->GetX() + $imagesize + 0.1, $pdf->GetY() + 0.2 * ($ff + 2), $value); $pdf->SetXY($currentx, $currenty);
$imagesize = getimagesize($imgpath); $whratio = $imagesize[0] / $imagesize[1]; $hwratio = $imagesize[1] / $imagesize[0]; if ($whratio < 1) { $imageheight = $height - 4; // vertical images can take up half the page $whratio = $imagesize[0] / $imagesize[1]; $imagewidth = $imageheight * $whratio; } if ($whratio >= 1 || $imagewidth > $width + 1) { $imagewidth = $width - 1; // horizontal images are scaled to width - 1 in $hwratio = $imagesize[1] / $imagesize[0]; $imageheight = $imagewidth * $hwratio; } $pdf->Text(0.5, 0.5, i18n_get_translated($resourcedata['field' . $view_title_field]) . ' ' . $date); $pdf->Image($imgpath, ($width - 1) / 2 - ($imagewidth - 1) / 2, 1, $imagewidth, $imageheight, "jpg", $baseurl . '/?r=' . $ref); // set color for background $pdf->SetFillColor(255, 255, 200); $style = array('width' => 0.01, 'cap' => 'butt', 'join' => 'round', 'dash' => '0', 'color' => array(100, 100, 100)); $style1 = array('width' => 0.04, 'cap' => 'butt', 'join' => 'round', 'dash' => '0', 'color' => array(255, 255, 0)); $style2 = array('width' => 0.02, 'cap' => 'butt', 'join' => 'round', 'dash' => '3', 'color' => array(255, 0, 0)); $ypos = $imageheight + 1.5; $pdf->SetY($ypos); $m = 1; unset($notes); if ($resources[$n]['annotation_count'] != 0) { $notes = sql_query("select * from annotate_notes where ref='{$ref}'"); foreach ($notes as $note) { $ratio = $imagewidth / $note['preview_width']; $note_y = $note['top_pos'] * $ratio;
public function Footer() { if ($this->page != 1) { // Position at 15 mm from bottom $this->SetY(-15); // Set font $this->SetFont('times', '', 11); // Page number $this->Cell(0, 0, $this->getAliasNumPage(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } } $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, 'test'); $pdf->setStoryTitle($title[0]['title']); $pdf->finished($finished[0]['date']); $pdf->setstoryWriters($writers); $pdf->setHeaderFont(array('times', '', 25)); $pdf->setFooterData(array(0,64,0), array(0,64,128)); $pdf->setMargins(10,30,10,30); $pdf->AddPage(); $pdf->AddPage(); $text = ''; foreach($words as $word) { $text .= ' ' . $word['words']; } $pdf->Text(9,35,$text,0); $pdf->SetFont('courier'); $pdf->setCellHeightRatio(3); // $pdf->MultiCell(0, 0, 0, 0, 'L', false, 1, 10, 30, true, 2, false, true, 0, 'T', true); $pdf->Output('GN_' . $title[0]['title'] . '.pdf', 'I'); ?>