当前位置: 首页>>代码示例>>PHP>>正文


PHP FPDF::SetTopMargin方法代码示例

本文整理汇总了PHP中FPDF::SetTopMargin方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::SetTopMargin方法的具体用法?PHP FPDF::SetTopMargin怎么用?PHP FPDF::SetTopMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FPDF的用法示例。


在下文中一共展示了FPDF::SetTopMargin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPdf

 function getPdf($image)
 {
     require JPATH_SITE . "/components/com_flexpaper/fpdf/fpdf.php";
     $filePath = JPATH_SITE . "/components/com_flexpaper/output/certificate.pdf";
     $pdf = new FPDF('L', 'mm');
     $pdf->SetLeftMargin(0);
     $pdf->SetRightMargin(0);
     $pdf->SetTopMargin(0);
     $pdf->SetAutoPageBreak(false);
     $pdf->AddPage();
     $pdf->Image($image);
     $pdf_file = $pdf->Output($filePath, 'F');
     return $pdf_file;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:14,代码来源:certificate.php

示例2: die

<?php

//require ("fpdf/fpdf.php");
$uid = $this->session->userdata('uid');
if (!$uid) {
    die("You must login to do that.");
}
$sid = $this->db->query("SELECT `store` FROM `employees` WHERE `uniq_id` = (SELECT `employee_id` FROM `warnings` WHERE `warning_id` = {$warning_id} LIMIT 0,1)");
$sid = $sid->first_row();
$verified = $this->cpm_functions->verify_access($uid, $sid->store);
if ($verified) {
    $pdf = new FPDF();
    $pdf->addFont("barCode39fHR", "", "bar39fh.php");
    $pdf->SetRightMargin(160);
    $pdf->SetTopMargin(118);
    $pdf->SetAutoPageBreak(TRUE, 62);
    $pdf->AddPage();
    $pdf->addFont("BarCode39fHR", "", "bar39fh.php");
    $bottom = $this->cpm_pdflayouts->warning_bottom($warning_id);
    $information = $this->cpm_pdflayouts->warning_info($warning_id);
    if ($information !== FALSE && $bottom !== FALSE) {
        foreach ($information as $val) {
            switch ($val["type"]) {
                case "SetRightMargin":
                    $pdf->SetRightMargin($val[0]);
                    break;
                case "SetTopMargin":
                    $pdf->SetTopMargin($val[0]);
                    break;
                case "MultiCell":
                    $pdf->MultiCell($val[0], $val[1], $val[2], $val[3], $val[4]);
开发者ID:jedbrundidge,项目名称:CarischCpm,代码行数:31,代码来源:pdf_warning_view.php

示例3: genSalon

 function genSalon()
 {
     global $options;
     # paramètres
     $mg = 5;
     // Marge de gauche =>  initial 17
     $mh = 4;
     // Marge du haut =>  initial 9
     $md = 15;
     // Marge de droite
     $mb = 9;
     // Marge du bas
     $largeur_etiquette = 42;
     // largeur_etiquette =>  initial 60
     $espace_etiquettes = 13;
     // =>  initial 7
     $nb_ligne_etiquettes = 4;
     $nb_etiquette_ligne = 5;
     // Préparation du document PDF.
     $pdf = new FPDF('L', 'mm', 'A4');
     $pdf->Open();
     $pdf->SetLeftMargin($mg);
     $pdf->SetTopMargin($mh);
     $pdf->SetAutoPageBreak(1, 0);
     $pdf->AddPage();
     // Gestion des fonts
     $pdf->AddFont('code39', '', 'IDAutomation_Code_39.php');
     $pdf->SetFont('times', '', 12);
     // Préparation des informations.
     $nom = strtoupper($this->patient->getNom());
     $prenom = strtoupper($this->patient->getPrenom());
     $date = new clDate($this->patient->getDateNaissance());
     $duree = new clDuree();
     $dateN = $date->getDate("d/m/Y");
     $dateN .= " (" . $duree->getAge($date->getTimestamp()) . ")";
     if ($this->patient->getSexe() == "F") {
         $sexe = "Féminin";
         $e = "e";
     } elseif ($this->patient->getSexe() == "M") {
         $sexe = "Masculin";
         $e = "";
     } else {
         $sexe = "Indéterminé";
         $e = "";
     }
     $date->setDate($this->patient->getDateAdmission());
     $le = $date->getDate("d/m/Y H:i");
     $led = $date->getDate("d/m/Y");
     $leh = $date->getDate("H:i");
     $ipp = $this->patient->getILP();
     $nsej = $this->patient->getNSej();
     $uf = $this->patient->getUF();
     $sexe = $this->patient->getSexe();
     if ($uf == $options->getOption('numUFexec')) {
         $loc = '(URGENCES)';
     } else {
         $loc = '(UHCD)';
     }
     $tel = $this->patient->getTel();
     $adresse = $this->patient->getAdresse();
     $cpv = $this->patient->getCodePostal() . " " . $this->patient->getVille();
     $prev = $this->patient->getPrevenir();
     $medt = $this->patient->getMedecinTraitant();
     $modet = $this->patient->getMedecinTraitant();
     $adresseur = $this->patient->getAdresseur();
     $modeadm = $this->patient->getModeAdmission();
     // Grosse étiquette
     $pdf->Cell(20, 4, "", 0, 0, L);
     // Ligne 1
     $pdf->Cell(4 * $largeur_etiquette, 5, "CENTRE HOSPITALIER DE CARPENTRAS", 0, 1, L);
     // Ligne 2
     $pdf->Cell(11, 5, "Date : ", 0, 0, L);
     $pdf->SetFont('times', 'B', 12);
     $pdf->Cell(23, 5, "{$led}", 0, 0, L);
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(13, 5, "Heure : ", 0, 0, L);
     $pdf->SetFont('times', 'B', 12);
     $pdf->Cell(27, 5, "{$leh}", 0, 0, L);
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(21, 5, "N° Patient : ", 0, 0, L);
     $pdf->SetFont('times', 'B', 12);
     $pdf->Cell(22, 5, "{$ipp}", 0, 0, L);
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(18, 5, "N° URG : ", 0, 0, L);
     $pdf->SetFont('times', 'B', 12);
     $pdf->Cell(22, 5, "{$nsej}", 0, 0, L);
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(18, 5, "N° ARCHIVE : ", 0, 1, L);
     // Ligne 3
     $pdf->Cell(11, 5, "Nom : ", 0, 0, L);
     $pdf->SetFont('times', 'B', 12);
     $pdf->Cell(63, 5, strtoupper($nom), 0, 0, L);
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(13, 5, "Nom naissance : ", 0, 1, L);
     // Ligne 4
     $pdf->Cell(16, 5, "Prénom : ", 0, 0, L);
     $pdf->SetFont('times', 'B', 12);
     $pdf->Cell(58, 5, ucfirst(strtolower($prenom)), 0, 0, L);
     $pdf->SetFont('times', '', 12);
     $pdf->Cell(12, 5, "Sexe : ", 0, 0, L);
//.........这里部分代码省略.........
开发者ID:jeromecc,项目名称:tuv2,代码行数:101,代码来源:clEtiquettes.php

示例4: FPDF

 function __construct($lineItems, $lineItemTotals, $filename, $save = false)
 {
     App::import('vendor', 'fpdf/fpdf');
     $orientation = 'P';
     $unit = 'pt';
     $format = 'A4';
     $margin = 40;
     $pdf = new FPDF($orientation, $unit, $format);
     App::import('Helper', 'Time');
     $timeHelper = new TimeHelper();
     setlocale(LC_MONETARY, 'th_TH');
     $pdf->AddPage();
     $pdf->SetTopMargin($margin);
     $pdf->SetLeftMargin($margin);
     $pdf->SetRightMargin($margin);
     $pdf->SetAutoPageBreak(true, $margin);
     $pdf->SetY($pdf->GetY() + 60);
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetTextColor(0);
     $pdf->SetFillColor(255);
     $pdf->SetLineWidth(1);
     $pdf->SetFont('Arial', 'B', '10');
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 30;
     $pdf->MultiCell($cell_width, 25, "No.\n ", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $pdf->Cell(250, 25, "Description", 'LTR', 0, 'C');
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 48;
     $pdf->MultiCell($cell_width, 25, "# Ordered", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 48;
     $pdf->MultiCell($cell_width, 25, "# Supplied", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 70;
     $pdf->MultiCell($cell_width, 25, "Amount Wholesale", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 70;
     $pdf->MultiCell($cell_width, 25, "Amount Retail", 'LTR', 'C');
     $pdf->SetY($pdf->GetY() - 25);
     $pdf->SetFont('Arial', '');
     $pdf->SetFillColor(238);
     $pdf->SetLineWidth(0.2);
     $pdf->SetY($pdf->GetY() + 25);
     $num = 1;
     $number_ordered = 0;
     $number_supplied = 0;
     foreach ($lineItems as $lineItem) {
         $pdf->Cell(30, 20, $num++, 1, 0, 'L');
         $pdf->Cell(250, 20, $lineItem['Product']['short_description'], 1, 0, 'L');
         $pdf->Cell(48, 20, $lineItem['LineItem']['ordered'], 1, 0, 'R');
         $pdf->Cell(48, 20, $lineItem['LineItem']['supplied'], 1, 0, 'R');
         $pdf->Cell(70, 20, money_format("%i", $lineItem['LineItem']['amount_wholesale']), 1, 0, 'R');
         $pdf->Cell(70, 20, money_format("%i", $lineItem['LineItem']['amount_retail']), 1, 1, 'R');
     }
     $pdf->SetX($pdf->GetX() + 30);
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(250, 20, "TOTALS", 1);
     $pdf->SetFont('Arial', '');
     $pdf->Cell(48, 20, $lineItemTotals['LineItem']['ordered'], 1, 0, 'R');
     $pdf->Cell(48, 20, $lineItemTotals['LineItem']['ordered'], 1, 0, 'R');
     $pdf->Cell(70, 20, money_format("%i", $lineItemTotals['LineItem']['amount_wholesale']), 1, 0, 'R');
     $pdf->Cell(70, 20, money_format("%i", $lineItemTotals['LineItem']['amount_retail']), 1, 1, 'R');
     if ($save) {
         $pdf->Output($filename, 'F');
     } else {
         $pdf->Output($filename, 'I');
     }
 }
开发者ID:sunny36,项目名称:grecocos,代码行数:77,代码来源:supplier_batch_report.php

示例5: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('P', 'mm', 'Letter');
     if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) {
         $this->font = 'Gill';
         $this->alt_font = 'GillBook';
         define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
         $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     }
     $width = 52;
     // tag width in mm
     $bar_width = 50;
     $height = 31;
     // tag height in mm
     $left = 5.5;
     // left margin
     $top = 15;
     // top margin
     $pdf->SetTopMargin($top);
     //Set top margin of the page
     $pdf->SetLeftMargin($left);
     //Set left margin of the page
     $pdf->SetRightMargin($left);
     //Set the right margin of the page
     $pdf->SetAutoPageBreak(False);
     // manage page breaks yourself
     $data = $this->loadItems();
     $num = 0;
     // count tags
     $x = $left;
     $y = $top;
     $sign = 0;
     foreach ($data as $item) {
         // extract & format data
         $price = $item['normal_price'];
         $desc = $item['description'];
         $brand = strtoupper($item['brand']);
         $price = $item['normal_price'];
         if ($item['scale']) {
             if (substr($price, 0, 1) != '$') {
                 $price = sprintf('$%.2f', $price);
             }
             $price .= ' /lb.';
         } else {
             $price = $this->formatPrice($item['normal_price']);
         }
         if ($num % 32 == 0) {
             $pdf->AddPage();
             $x = $left;
             $y = $top;
             $sign = 0;
         } else {
             if ($num % 4 == 0) {
                 $x = $left;
                 $y += $height;
             }
         }
         $row = floor($sign / 4);
         $column = $sign % 4;
         $pdf->SetFillColor(86, 90, 92);
         $pdf->Rect($left + $width * $column, $top + $row * $height, $bar_width, 5, 'F');
         $pdf->Rect($left + $width * $column, $top + $row * $height + 25, $bar_width, 2, 'F');
         $pdf->SetXY($left + $width * $column, $top + $row * $height + 6);
         $pdf->SetFont($this->font, 'B', $this->SMALL_FONT);
         $pdf->MultiCell($width, 5, $brand, 0, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFont($this->font, '', $this->MED_FONT);
         $pdf->MultiCell($width, 5, $item['description'], 0, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFont($this->font, '', $this->BIG_FONT);
         $pdf->Cell($width, 8, $price, 0, 1, 'C');
         // move right by tag width
         $x += $width;
         $num++;
         $sign++;
     }
     $pdf->Output('Tags4x8P.pdf', 'I');
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:79,代码来源:RailSigns4x8P.php

示例6: FPDF

        //Posición: a 1,5 cm del final
        $this->SetY(-15);
        //Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        //Número de página
        $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
//$pdf->FPDF('P','mm','A4');
$pdf = new FPDF('P', 'cm', 'custom', 300.28, 458.92);
//ingreso medida puntos
//$pdf->Open();
$pdf->AliasNbPages();
$pdf->SetLeftMargin(0.7);
$pdf->PageNo();
$pdf->SetTopMargin(5);
$pdf->SetAutoPageBreak(0.6);
$pdf->AddPage();
$pdf->SetFont('Arial', '', 9);
$venta->ventas_ver($_REQUEST['venta']);
$nro_documento = $venta->ven_nrodoc;
$cliente_nombre = $venta->cli_razonsocial;
$cliente_direccion = $venta->cli_direccion;
$cliente_ruc = $venta->cli_ruc;
$e_fecha = $venta->_util->obtiene_fecha($venta->ven_fecha);
$fecha = explode("/", $e_fecha);
//si fecha esta en formato dia-mes-año
$dia = $fecha[0];
$mes = $venta->_util->ver_nombre_mes($fecha[1]);
$mes_numero = substr($fecha[3], 2);
$anio = substr($fecha[2], 3);
开发者ID:kailIII,项目名称:Sistema-de-ventas-1.0,代码行数:31,代码来源:venta_impresion.php

示例7: round

     $total = Student::get_attendance($cond);
     $attendence = round($total * 100 / $total_session, 2);
     $marks = Student::get_marks($cond);
     $m = round($marks * 100 / ($total_session * $mr), 2);
     if ($m >= 40 && $attendence >= 50) {
         $c++;
     }
     if ($m < 40 && $attendence >= 50) {
         $c1++;
     }
     $pdf->Cell(30, 5, "{$sno}", 0, 1, "L");
     $pdf->SetLeftMargin("22");
     $pdf->Cell(0, -5, ucwords(strtolower($row['name'])), 0, 1, "L");
     $pdf->SetLeftMargin("");
     $pdf->Cell(145, 5, $attendence . " %", 0, 1, "C");
     $pdf->SetTopMargin("50");
     $pdf->Cell(185, -2.25, "", 0, 1, "R");
     $pdf->Cell(135, 0, $m . " %", 0, 1, "R");
     $pdf->SetLeftMargin("165.5");
     $pdf->Cell(0, 0, Student::get_status($m, $attendence), 0, 1, "L");
     $pdf->SetLeftMargin("");
     $pdf->Cell(185, 1.25, "", 0, 1, "R");
     $pdf->SetLeftMargin("10");
 }
 $tc = $c + $c1;
 $pdf->Cell(0, 2, "", 0, 1);
 $pdf->Cell(0, 0, "", 1, 1);
 $pdf->Cell(0, 5, "Total Certificates Issued: {$tc}", 0, 1, "L");
 $pdf->Cell(0, 5, "Successful Completion Certificates : {$c}", 0, 1, "L");
 $pdf->Cell(0, 5, "Participation Certificates : {$c1}", 0, 1, "L");
 $pdf->Output("Certificate", 'I');
开发者ID:harishankar121,项目名称:gitrepogit,代码行数:31,代码来源:genrate_certificate.php

示例8: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('P', 'mm', 'Letter');
     if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) {
         $this->font = 'Gill';
         $this->alt_font = 'GillBook';
         define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
         $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     }
     $width = 52;
     // tag width in mm
     $height = 31;
     // tag height in mm
     $left = 6;
     // left margin
     $top = 16;
     // top margin
     $pdf->SetTopMargin($top);
     //Set top margin of the page
     $pdf->SetLeftMargin($left);
     //Set left margin of the page
     $pdf->SetRightMargin($left);
     //Set the right margin of the page
     $pdf->SetAutoPageBreak(False);
     // manage page breaks yourself
     $data = $this->loadItems();
     $num = 0;
     // count tags
     $x = $left;
     $y = $top;
     foreach ($data as $item) {
         // extract & format data
         $price = $item['normal_price'];
         $desc = strtoupper(substr($item['posDescription'], 0, 25));
         $brand = ucwords(strtolower(substr($item['brand'], 0, 13)));
         $pak = $item['units'];
         $size = $item['units'] . "-" . $item['size'];
         $sku = $item['sku'];
         $ppu = $item['pricePerUnit'];
         $vendor = substr($item['vendor'], 0, 7);
         $upc = $item['upc'];
         if ($num % 32 == 0) {
             $pdf->AddPage();
             $x = $left;
             $y = $top;
         } else {
             if ($num % 4 == 0) {
                 $x = $left;
                 $y += $height;
             }
         }
         $pdf->SetFont($this->font, '', 8);
         $pdf->SetXY($x, $y);
         // try normal wordwrap
         // but squeeze into two lines if needed
         $wrapped = wordwrap($desc, 12, "\n", true);
         if (count(explode("\n", $wrapped)) > 2) {
             $wrapped = substr($desc, 0, 12);
             if ($wrapped[11] != ' ') {
                 $wrapped .= '-';
             }
             $wrapped .= "\n";
             $wrapped .= trim(substr($desc, 12));
         }
         $pdf->MultiCell($width / 2, 3, $wrapped, 0, 'L');
         $pdf->SetX($x);
         $pdf->Cell($width / 2, 3, date('n/j/y ') . $size, 0, 1, 'L');
         $pdf->SetFont($this->font, 'B', 18);
         //change font for price
         $pdf->SetX($x);
         $pdf->Cell($width / 2, 8, $price, 0, 1, 'L');
         $args = array('height' => 7, 'align' => 'L', 'fontsize' => 8, 'width' => 0.23, 'font' => $this->font);
         $b_y = $pdf->GetY();
         $pdf = $this->drawBarcode($upc, $pdf, $x, $b_y, $args);
         // move right by tag width
         $x += $width;
         $num++;
     }
     $pdf->Output('Tags4x8P.pdf', 'I');
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:81,代码来源:HalfTags4x8P.php

示例9: generatePDF

/**
 * generatePDF - Génère un fichier PDF à partir des données d'évaluation d'un service
 *
 * @category : eval_ccpc_functions
 * @param array $data Données d'évaluation récupérées à partir de la fonction {@link getEvaluationCCPCFullData()}
 * @param boolean $comment TRUE si on incut les commentaire, FALSE si on ne les inclut pas
 * @param boolean $commentMSG TRUE si on incut un message concernant la CSG, FALSE si on ne l'inclut pas
 * @return array Array contenant les informations du fichier généré
 *
 * @Author Ali Bellamine
 *
 * Contenu de l'array retourné :<br>
 * 	['pdfPath'] => (string) Chemin local vers le fichier généré<br>
 * 	['pdfURI'] => (string) URI pointant vers le fichier généré
 *
 */
function generatePDF($data, $comment = FALSE, $commentMSG = FALSE)
{
    // Accès à la BDD
    global $db;
    // Array contenant les résultats
    $output = array();
    // On vérifie l'existence des données
    if (isset($data) && count($data) > 0) {
        /* 
        	Mise en cache
        */
        // Calcul du md5
        $hashdata = $data;
        $hashdata['optionsPDF'] = array('comment' => $comment, 'commentMSG' => $commentMSG);
        $hash = md5(json_encode($hashdata));
        $pdfPath = PLUGIN_PATH . 'cache/' . $hash . '.pdf';
        $pdfPathURI = ROOT . 'evaluations/ccpc/cache/' . $hash . '.pdf';
        if (is_file($pdfPath)) {
            $output['pdfPath'] = $pdfPath;
            $output['pdfURI'] = $pdfPathURI;
            return $output;
        } else {
            // On charge la librairie
            require_once PLUGIN_PATH . 'core/fpdf17/fpdf.php';
            // On charge le fichier XML
            if (is_file(PLUGIN_PATH . 'formulaire.xml')) {
                $form = simplexml_load_file(PLUGIN_PATH . 'formulaire.xml');
            }
            // Promotion
            if (count($data['service']['promotion']) > 1) {
                $promotion = false;
            } else {
                foreach ($data['service']['promotion'] as $promotionData) {
                    $promotion = $promotionData['id'];
                }
            }
            try {
                ob_end_clean();
            } catch (Exception $e) {
            }
            // On crée le PDF
            $A4Height = 842;
            $A4Width = 595;
            $titleSize = 15;
            $textSize = 11;
            $pdf = new FPDF('L', 'pt', 'A4');
            $pdf->SetTopMargin(10);
            $pdf->SetLeftMargin(15);
            $pdf->SetAutoPageBreak(TRUE, 10);
            /**
            						Page contenant le résumé des données d'évaluation
            					**/
            $pdf->AddPage();
            $pdf->SetFont('Arial', 'B', $titleSize);
            // On affiche le titre
            $pdf->SetFillColor(70, 70, 242);
            $pdf->SetTextColor(255, 255, 255);
            $pdf->SetX(floor(0.1 * $A4Height));
            $pdf->Cell(floor(0.8 * $A4Height), $titleSize + 5, utf8_decode(LANG_FORM_CCPC_PDF_TITLE), 'LRTB', 0, 'C', TRUE);
            // Première ligne
            $pdf->Ln(2 * $titleSize);
            $pdf->SetFont('Arial', '', $textSize);
            // On affiche les informations concernant le service
            // Récupération des données
            $textToDisplay = LANG_FORM_CCPC_FILTER_SERVICE_TITLE . ' : ' . $data['service']['FullName'] . PHP_EOL . LANG_FORM_CCPC_PDF_STAGEPERIODE . ' : ' . date('d/m/Y', $data['service']['date']['min']) . ' - ' . date('d/m/Y', $data['service']['date']['max']);
            // Nombre d'étudiants par promotion
            $nbEtudiantsService = array();
            $sql = 'SELECT p.nom promotion, COUNT( ae.userId ) nombre
												FROM `affectationexterne` ae
												INNER JOIN user u ON u.id = ae.userId
												INNER JOIN promotion p ON p.id = u.promotion
												WHERE `dateDebut` >= "' . TimestampToDatetime($data['service']['date']['min']) . '" AND `dateFin` <= "' . TimestampToDatetime($data['service']['date']['max']) . '" AND service = ' . $data['service']['id'] . '
												GROUP BY u.promotion';
            $res = $db->query($sql);
            while ($res_f = $res->fetch()) {
                $nbEtudiantsService[$res_f['promotion']] = $res_f['nombre'];
            }
            $firstLoop = true;
            if (count($nbEtudiantsService) > 0) {
                $textToDisplay .= PHP_EOL . LANG_FORM_CCPC_PDF_STUDENTPROMOTION . ' : ';
                foreach ($nbEtudiantsService as $promotionNom => $promotionNombre) {
                    if (!$firstLoop) {
                        $textToDisplay .= ', ';
                    } else {
//.........这里部分代码省略.........
开发者ID:alibell,项目名称:PAS,代码行数:101,代码来源:fnDisplayEvaluationResult.php

示例10: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('P', 'mm', 'Letter');
     $width = 52;
     // tag width in mm
     $height = 31;
     // tag height in mm
     $left = 5.5;
     // left margin
     $top = 15;
     // top margin
     $pdf->SetTopMargin($top);
     //Set top margin of the page
     $pdf->SetLeftMargin($left);
     //Set left margin of the page
     $pdf->SetRightMargin($left);
     //Set the right margin of the page
     $pdf->SetAutoPageBreak(False);
     // manage page breaks yourself
     $data = $this->loadItems();
     $num = 0;
     // count tags
     $x = $left;
     $y = $top;
     foreach ($data as $item) {
         // extract & format data
         $price = $item['normal_price'];
         $desc = strtoupper(substr($item['posDescription'], 0, 27));
         $brand = strtoupper(substr($item['brand'], 0, 13));
         $pak = $item['units'];
         $size = $item['units'] . "-" . $item['size'];
         $sku = $item['sku'];
         $ppu = $item['pricePerUnit'];
         $vendor = substr($item['vendor'], 0, 7);
         $upc = $item['upc'];
         if ($num % 32 == 0) {
             $pdf->AddPage();
             $x = $left;
             $y = $top;
         } else {
             if ($num % 4 == 0) {
                 $x = $left;
                 $y += $height;
             }
         }
         $args = array('height' => 7, 'valign' => 'T', 'align' => 'L', 'suffix' => date('  n/j/y'), 'fontsize' => 8, 'font' => $this->font);
         $pdf = $this->drawBarcode($upc, $pdf, $x + 7, $y + 4, $args);
         $pdf->SetFont($this->font, '', 8);
         $pdf->SetXY($x, $y + 12);
         $pdf->Cell($width, 4, $desc, 0, 1, 'L');
         $pdf->SetX($x);
         $pdf->Cell($width, 4, $brand, 0, 1, 'L');
         $pdf->SetX($x);
         $pdf->Cell($width, 4, $size, 0, 1, 'L');
         $pdf->SetX($x);
         $pdf->Cell($width, 4, $sku . ' ' . $vendor, 0, 0, 'L');
         if (strstr($ppu, '/') && $ppu[strlen($ppu) - 1] != '/') {
             $pdf->SetX($x);
             $pdf->Cell($width - 5, 4, $ppu, 0, 0, 'R');
         }
         $pdf->SetXY($x, $y + 16);
         $pdf->SetFont($this->font, 'B', 24);
         //change font size
         $pdf->Cell($width - 5, 8, $price, 0, 0, 'R');
         // move right by tag width
         $x += $width;
         $num++;
     }
     $pdf->Output('Tags4x8P.pdf', 'I');
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:70,代码来源:Tags4x8P.php

示例11: generar_pdf

 public function generar_pdf($id_cor, $id_direccion_gen)
 {
     $correspondencia = $this->ivss_model->core_parcial($id_cor)->result();
     $direccion_general = $this->ivss_model->ver_direccion_general_especifica($id_direccion_gen);
     foreach ($correspondencia as $cor_item) {
         $id_cor_oficio = $cor_item->id_cor;
         $num_control_oficio = $cor_item->num_control;
         $dir_origen_oficio = $cor_item->dir_origen;
         $remitente_oficio = $cor_item->remitente;
         $dir_destino_oficio = $cor_item->dir_destino;
         $asunto_oficio = $cor_item->asunto;
         $descripcion_oficio = $cor_item->descripcion;
         $fecha_crea_oficio = $cor_item->fecha_creacion;
     }
     $datos_director = $this->ivss_model->ver_dir_gen_especifica2($dir_destino_oficio)->result();
     foreach ($datos_director as $dir) {
         $nombre_director = $dir->nombre_director;
         $resolucion_director = $dir->resolucion_director;
     }
     $this->load->library('fpdf/fpdf');
     $pdf = new FPDF('P');
     $pdf->AddPage();
     $pdf->SetTitle("correspondencia", true);
     $pdf->SetFont('Arial', 'B', 16);
     $pdf->Image($this->config->base_url() . 'fronted/img/banner_institucional.png', 20, 8, 170);
     $pdf->AliasNbPages();
     $pdf->SetSubject("Sistema de correspondencia");
     $pdf->Image($this->config->base_url() . 'fronted/img/logogrande.png', 20, 25, 17);
     $pdf->SetFont('Arial', '', 9);
     $pdf->Text(68, 30, "REPUBLICA BOLIVARIANA DE VENEZUELA");
     $pdf->Text(42, 40, "MINISTERIO DEL PODER POPULAR PARA EL PROCESO SOCIAL DEL TRABAJO");
     $pdf->Text(62, 50, "INSTITUTO VENEZOLANO DE LOS SEGUROS SOCIALES");
     $pdf->SetLeftMargin(20.0);
     $pdf->SetRightMargin(20.0);
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Text(20, 70, "OFICIO:");
     $pdf->SetFont('Arial', '', 12);
     $pdf->Text(44, 70, $num_control_oficio);
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Text(20, 80, "PARA:");
     $pdf->SetFont('Arial', 'b', 12);
     #$pdf->Text(44,80,strtoupper(utf8_decode($nombre_director)));
     $pdf->Text(44, 80, strtoupper(utf8_decode("JACINTO PEREZ BONALDE SANCHEZ")));
     $pdf->SetFont('Arial', '', 12);
     $pdf->Text(44, 90, utf8_decode($dir_destino_oficio));
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Text(20, 100, "DE:");
     $pdf->SetFont('Arial', 'b', 12);
     $pdf->Text(44, 100, utf8_decode($remitente_oficio));
     $pdf->SetFont('Arial', '', 12);
     $pdf->Text(44, 110, utf8_decode(end(explode("-", $dir_origen_oficio))));
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Text(20, 120, "FECHA:");
     $pdf->SetFont('Arial', '', 12);
     $pdf->Text(44, 120, $fecha_crea_oficio);
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Text(20, 130, "ASUNTO:");
     $pdf->SetFont('Arial', '', 12);
     $pdf->Text(44, 130, utf8_decode($asunto_oficio));
     $pdf->SetXY(10, 140);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetTopMargin(2.0);
     $pdf->SetLeftMargin(20.0);
     $pdf->SetRightMargin(20.0);
     $pdf->MultiCell(0, 7, utf8_decode($descripcion_oficio));
     $pdf->SetFont('Arial', 'b', 10);
     $pdf->Text(93, 245, "Atentamente");
     $pdf->Line(50, 264, 160, 264);
     #$pdf->Image($this->config->base_url().'fronted/img/FIRMADIGITAL.png',52,230,115);
     $pdf->SetFont('Arial', '', 10);
     $pdf->Text(75, 268, utf8_decode($remitente_oficio));
     $pdf->SetFont('Arial', '', 10);
     $pdf->Text(88, 272, utf8_decode("Director general"));
     $pdf->SetFont('Arial', '', 10);
     $pdf->Text(76, 276, utf8_decode("Según resolución:" . $resolucion_director));
     $pdf->Output('oficio_' . $num_control_oficio, 'I');
     #tabla
     /*
     $cabecera=array('Usuario', 'Total asignados', 'Ejecutados');
     $pdf->SetXY(10,30); //Seleccionamos posición
     $pdf->SetFont('Arial','B',10); //Fuente, Negrita, tamaño
      
         foreach($cabecera as $columna){
             //Parámetro con valor 2, cabecera vertical
             $pdf->Cell(50,7, utf8_decode($columna),1, 0,'L');
         }
     
     $pdf->SetXY(10,31);
     $pdf->Ln();//Salto de línea para generar otra fila
     $pdf->Ln();//Salto de línea para generar otra fila
         foreach($cabecera as $fila){
                 //Atención!! el parámetro valor 0, hace que sea horizontal
                 $pdf->Cell(50,7, utf8_decode($fila),1, 0 , '' );
             }
     */
     #llave clase.
 }
开发者ID:vanckruz,项目名称:correspondence,代码行数:97,代码来源:director_general.php

示例12: generatePDF

/**
 * generatePDF - Génère un fichier PDF à partir des données d'évaluation d'un service
 *
 * @category : eval_ccpc_functions
 * @param array $data Données d'évaluation récupérées à partir de la fonction {@link getEvaluationCCPCFullData()}
 * @param boolean $comment TRUE si on incut les commentaire, FALSE si on ne les inclut pas
 * @param boolean $commentMSG TRUE si on incut un message concernant la CSG, FALSE si on ne l'inclut pas
 * @return array Array contenant les informations du fichier généré
 *
 * @Author Ali Bellamine
 *
 * Contenu de l'array retourné :<br>
 * 	['pdfPath'] => (string) Chemin local vers le fichier généré<br>
 * 	['pdfURI'] => (string) URI pointant vers le fichier généré
 *
 */
function generatePDF($data, $comment = FALSE, $commentMSG = FALSE)
{
    // Array contenant les résultats
    $output = array();
    // On vérifie l'existence des données
    if (isset($data) && count($data) > 0) {
        /* 
        	Mise en cache
        */
        // Calcul du md5
        $hashdata = $data;
        $hashdata['optionsPDF'] = array('comment' => $comment, 'commentMSG' => $commentMSG);
        $hash = md5(json_encode($hashdata));
        $pdfPath = PLUGIN_PATH . 'cache/' . $hash . '.pdf';
        $pdfPathURI = ROOT . 'evaluations/ccpc/cache/' . $hash . '.pdf';
        if (is_file($pdfPath)) {
            $output['pdfPath'] = $pdfPath;
            $output['pdfURI'] = $pdfPathURI;
            return $output;
        } else {
            // On charge la librairie
            require_once PLUGIN_PATH . 'core/fpdf17/fpdf.php';
            // On charge le fichier XML
            if (is_file(PLUGIN_PATH . 'formulaire.xml')) {
                $form = simplexml_load_file(PLUGIN_PATH . 'formulaire.xml');
            }
            // Promotion
            if (count($data['service']['promotion']) > 1) {
                $promotion = false;
            } else {
                foreach ($data['service']['promotion'] as $promotionData) {
                    $promotion = $promotionData['id'];
                }
            }
            ob_end_clean();
            // On crée le PDF
            $A4Height = 842;
            $A4Width = 595;
            $titleSize = 15;
            $textSize = 11;
            $pdf = new FPDF('L', 'pt', 'A4');
            $pdf->SetTopMargin(10);
            $pdf->SetLeftMargin(15);
            $pdf->SetAutoPageBreak(TRUE, 10);
            /**
            						Page contenant le résumé des données d'évaluation
            					**/
            $pdf->AddPage();
            $pdf->SetFont('Arial', 'B', $titleSize);
            // On affiche le titre
            $pdf->SetFillColor(70, 70, 242);
            $pdf->SetTextColor(255, 255, 255);
            $pdf->SetX(floor(0.1 * $A4Height));
            $pdf->Cell(floor(0.8 * $A4Height), $titleSize + 5, utf8_decode(LANG_FORM_CCPC_PDF_TITLE), 'LRTB', 0, 'C', TRUE);
            // Première ligne
            $pdf->Ln(2 * $titleSize);
            $pdf->SetFont('Arial', '', $textSize);
            // On affiche les informations concernant le service
            // Récupération des données
            $textToDisplay = LANG_FORM_CCPC_FILTER_SERVICE_TITLE . ' : ' . $data['service']['FullName'] . PHP_EOL . LANG_FORM_CCPC_PDF_STAGEPERIODE . ' : ' . date('d/m/Y', $data['service']['date']['min']) . ' - ' . date('d/m/Y', $data['service']['date']['max']) . PHP_EOL . LANG_FORM_CCPC_PDF_STUDENTPROMOTION . ' : ';
            $firstLoop = true;
            foreach ($data['service']['promotion'] as $promotionData) {
                if (!$firstLoop) {
                    $textToDisplay .= ', ';
                } else {
                    $firstLoop = FALSE;
                }
                $textToDisplay .= $promotionData['nom'] . ' (' . $promotionData['nb'] . ')';
            }
            $textToDisplay .= PHP_EOL . LANG_FORM_CCPC_PDF_STUDENTNB . ' : ' . $data['service']['nbEvaluation'] . PHP_EOL . LANG_FORM_CCPC_PDF_EVALUATIONNB . ' : ' . $data['nb'];
            $textToDisplay = utf8_decode($textToDisplay);
            // Affichage
            $pdf->SetFillColor(231, 231, 231);
            $pdf->SetTextColor(0, 0, 0);
            $pdf->MultiCell(floor(0.35 * $A4Height), $textSize + 5, $textToDisplay, 'LRTB', 'L', TRUE);
            // On affiche les graphiques : mainGraphPDF
            // Récupération des données
            // Liste des graphiques à afficher
            $input = $form->xpath('categorie/input[@mainPDFGraph="1"]');
            $nbGraph = count($input);
            // Nombre de graphiques à intégrer
            // On génère $tempData, contenant les données utilisées pour génération du png
            foreach ($input as $select) {
                if ($select['type'] == 'select') {
//.........这里部分代码省略.........
开发者ID:Galinijay,项目名称:PAS,代码行数:101,代码来源:fnDisplayEvaluationResult.php

示例13: statistiqueParticipationsAction

 /**
  * @Template()     *
  * @Route("/statistique-participations/", name="statistiqueparticipations")
  */
 public function statistiqueParticipationsAction(Request $request)
 {
     $em = $this->getDoctrine()->getManager();
     if (!$this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
         $user = $this->getUser();
         $id = $user->getId();
         $activites = $this->get("alb_inscriptions.alb_manager")->getActivitesAdherent($id);
         $bureau = $this->get("alb_inscriptions.alb_manager")->isBureau($id, $activites);
         if ($bureau) {
             $groupes = $this->get("alb_inscriptions.alb_manager")->getGroupesAdherent($id);
             $activitesgroupe = $em->getRepository('ALBInscriptionsBundle:Activites')->findByIdgroupes($groupes);
             foreach ($activitesgroupe as $activite) {
                 $activites[] = $activite->getId();
             }
         }
         $activites = $this->get("alb_inscriptions.alb_manager")->getListeActivites($activites);
     } else {
         $activites = $em->getRepository('ALBInscriptionsBundle:Activites')->findAll();
         $groupes = $em->getRepository('ALBInscriptionsBundle:Groupes')->findAll();
     }
     if ('POST' === $request->getMethod()) {
         $activite = $request->get('activite');
         $groupe = $request->get('groupe');
         if ($activite > 0) {
             $nomactivite = $em->getRepository('ALBInscriptionsBundle:Activites')->find($activite)->getActivite();
         } elseif ($groupe > 0) {
             $nomactivite = $em->getRepository('ALBInscriptionsBundle:groupes')->find($groupe)->getGroupe();
         } else {
             $nomactivite = 'Toutes';
         }
         $datedebut = $request->get('datedebut');
         $datefin = $request->get('datefin');
         $nb = 0;
         if ($activite > 0) {
             $participants = $this->get("alb_inscriptions.alb_manager")->getListeParticipantsActivite($activite);
         } else {
             $participants = $this->get("alb_inscriptions.alb_manager")->getListeParticipants($groupe);
         }
         $nomfichier = 'statistiques/' . $activite . '.pdf';
         $pdf = new \FPDF();
         $pdf->Open();
         $pdf->SetTopMargin(5);
         $pdf->AddPage();
         $pdf->SetFont('Arial', 'B', 14);
         $pdf->Cell(0, 5, utf8_decode('Amicale Laïque de Billère'), 0, 1, 'C');
         $pdf->ln(2);
         $pdf->SetFont('Arial', '', 12);
         $pdf->Cell(0, 5, utf8_decode('Liste des présences aux sorties ' . $nomactivite . ' entre le ' . substr($datedebut, 8, 2) . '/' . substr($datedebut, 5, 2) . '/' . substr($datedebut, 0, 4) . ' et le ' . substr($datefin, 8, 2) . '/' . substr($datefin, 5, 2) . '/' . substr($datefin, 0, 4)), 0, 1);
         $pdf->ln(2);
         $pdf->SetFont('Arial', '', 8);
         $pdf->SetFont('Arial', 'B', 8);
         $pdf->Cell(5, 4, '', 1, 0, 'C');
         $pdf->Cell(50, 4, utf8_decode('Nom Prénom'), 1, 0, 'C');
         //$pdf->Cell(20,4,utf8_decode('Activité'),1,0,'C');
         $pdf->Cell(30, 4, utf8_decode('Nb de présence'), 1, 1, 'C');
         $pdf->SetFont('Arial', '', 8);
         $i = 0;
         $encadrement = false;
         foreach ($participants as $participant) {
             if ($participant->getAidemeneur() and !$encadrement) {
                 $pdf->Cell(55, 4, 'TOTAL', 1, 0, 'R');
                 $pdf->Cell(30, 4, $nb, 1, 1, 'C');
                 $nb = 0;
                 $encadrement = true;
                 $i = 0;
                 $pdf->SetFont('Arial', 'B', 8);
                 $pdf->Cell(85, 5, 'ENCADREMENT', 0, 1, 'C');
                 $pdf->SetFont('Arial', '', 8);
                 $pdf->Cell(5, 4, '', 1, 0, 'C');
                 $pdf->Cell(50, 4, utf8_decode('Nom Prénom'), 1, 0, 'C');
                 //$pdf->Cell(20,4,utf8_decode('Activité'),1,0,'C');
                 $pdf->Cell(30, 4, utf8_decode('Nb de présence'), 1, 1, 'C');
             }
             $i++;
             $pdf->Cell(5, 4, $i, 1, 0, 'C');
             $pdf->Cell(50, 4, utf8_decode($participant->getIdadherent()->getNom() . ' ' . $participant->getIdadherent()->getPrenom()), 1, 0, '');
             $id = $participant->getId();
             if ($activite > 0) {
                 $nbparticipation = $this->get("alb_inscriptions.alb_manager")->getNbParticipationActivite($activite, $id, $datedebut, $datefin);
             } else {
                 $nbparticipation = $this->get("alb_inscriptions.alb_manager")->getNbParticipationGroupe($groupe, $id, $datedebut, $datefin);
             }
             $pdf->Cell(30, 4, $nbparticipation, 1, 1, 'C');
             $nb = $nb + $nbparticipation;
         }
         $pdf->Cell(55, 4, 'TOTAL', 1, 0, 'R');
         $pdf->Cell(30, 4, $nb, 1, 1, 'C');
         $pdf->Output($nomfichier, 'F');
         $response = new Response();
         $response->setContent(file_get_contents($nomfichier));
         $response->headers->set('Content-Type', 'application/force-download');
         $response->headers->set('Content-disposition', 'filename=' . $nomfichier);
         return $response;
     }
     return array('activites' => $activites, 'groupes' => $groupes);
 }
开发者ID:albbillere,项目名称:inscriptions,代码行数:100,代码来源:SortiesController.php

示例14: FPDF

<?php

require 'fpdf16/fpdf.php';
require 'connection.php';
require 'functions.php';
$pdf = new FPDF();
$pdf->AliasNbPages();
$pdf->SetTopMargin(4);
$pdf->SetLeftMargin(6);
$pdf->SetAutoPageBreak(1, 0.5);
$pdf->SetDisplayMode(100);
$pdf->SetAutoPageBreak(true, 7);
$pdf->AddPage();
//$pdf->AddPage('L');
$pdf->SetDisplayMode(110, "single");
$pdf->SetTitle("Netherhall House");
$border = 1;
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetFillColor(255, 255, 255);
//------------
$pdf->Cell(180, 5, "Netherhall House", 0, 0, '', true);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(95, 5, $header, 0, 0, '', true);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(103, 5, date("d/m/Y"), 0, 0, 'R', true);
$pdf->SetFont('Arial', '', 7);
//ver_array("REQUEST", $request);
$arrClasses = array();
//ver_array("arrClasses",$arrClasses);
//The purpose of this page should only be to keep track of the residents who are currently in Netherhall.
开发者ID:albertcabre,项目名称:worldresidents,代码行数:31,代码来源:pdf_residents_expenses.php

示例15: explode

 if (isset($_GET['size'])) {
     $size = explode('-', $_GET['size']);
     $Pwidth = is_numeric($size[0]) ? $size[0] : $Pwidth;
     $Pheight = is_numeric($size[1]) ? $size[1] : $Pheight;
 }
 $fontSize = 16;
 $width = $Pwidth;
 $height = $Pheight;
 require $Fpdf_loc;
 $pdf = new FPDF('P', 'mm', array($width, $height));
 $full = isset($_GET['full']);
 $marginLeft = $full ? 0 : $width / 21.59;
 $marginTop = $full ? 0 : $height / 13.97;
 $pdf->SetLeftMargin($marginLeft);
 $pdf->SetRightMargin($marginLeft);
 $pdf->SetTopMargin($marginTop / 2);
 $pdf->SetAutoPageBreak(true, $marginTop);
 $pages = 0;
 $files = json_decode($_GET['json']);
 if ($files == null) {
     $files = array();
 }
 foreach ($files as $key => $val) {
     $file = $key;
     if (is_numeric(strpos($file, "/"))) {
         $file = substr($file, strrpos($file, "/") + 1);
     }
     $file = "Scan_{$file}";
     if (!is_file("scans/file/{$file}")) {
         continue;
     }
开发者ID:mehulsbhatt,项目名称:PHP-Scanner-Server,代码行数:31,代码来源:download.php


注:本文中的FPDF::SetTopMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。