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


PHP FPDF::GetStringWidth方法代码示例

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


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

示例1: generate_attendees_PDF

 public final function generate_attendees_PDF($tickets_list)
 {
     $this->load_pdf_libraries();
     $pdf = new FPDF();
     $ecp = TribeEvents::instance();
     $pdf->AddFont('OpenSans', '', 'opensans.php');
     $pdf->AddFont('SteelFish', '', 'steelfish.php');
     $pdf->SetTitle('EventTicket');
     $pdf->SetAuthor('The Events Calendar');
     $pdf->SetCreator('The Events Calendar');
     $defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => '');
     foreach ($tickets_list as $ticket) {
         $ticket = wp_parse_args($ticket, $defaults);
         $event = get_post($ticket['event_id']);
         $venue_id = tribe_get_venue_id($event->ID);
         $venue = !empty($venue_id) ? get_post($venue_id)->post_title : '';
         $address = tribe_get_address($event->ID);
         $zip = tribe_get_zip($event->ID);
         $state = tribe_get_stateprovince($event->ID);
         $city = tribe_get_city($event->ID);
         $pdf->AddPage();
         $pdf->SetDrawColor(28, 166, 205);
         $pdf->SetFillColor(28, 166, 205);
         $pdf->Rect(15, 10, 180, 34, 'F');
         $pdf->SetTextColor(255);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 15);
         $pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar'));
         $pdf->SetXY(30, 28);
         $pdf->SetFont('SteelFish', '', 53);
         $title = strtoupper(utf8_decode($event->post_title));
         $size = 53;
         while ($pdf->GetStringWidth($title) > 151) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $title);
         $pdf->SetTextColor(41);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 50);
         $pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar'));
         $pdf->SetXY(104, 50);
         $pdf->Write(5, __('LOCATION:', 'tribe-events-calendar'));
         $pdf->SetFont('SteelFish', '', 30);
         $pdf->SetXY(30, 59);
         $holder = strtoupper(utf8_decode($ticket['holder_name']));
         $size = 30;
         while ($pdf->GetStringWidth($holder) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $holder);
         $pdf->SetXY(104, 59);
         $venue = strtoupper(utf8_decode($venue));
         $size = 30;
         while ($pdf->GetStringWidth($venue) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $venue);
         $pdf->SetXY(104, 71);
         $address = strtoupper(utf8_decode($address));
         $size = 30;
         while ($pdf->GetStringWidth($address) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $address);
         $pdf->SetXY(104, 83);
         $address2 = array($city, $state, $zip);
         $address2 = array_filter($address2);
         $address2 = join(', ', $address2);
         $address2 = strtoupper(utf8_decode($address2));
         $size = 30;
         while ($pdf->GetStringWidth($address2) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $address2);
         $pdf->Line(15, 97, 195, 97);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 105);
         $pdf->Write(5, __('ORDER:', 'tribe-events-calendar'));
         $pdf->SetXY(80, 105);
         $pdf->Write(5, __('TICKET:', 'tribe-events-calendar'));
         $pdf->SetXY(120, 105);
         $pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar'));
         $pdf->SetFont('SteelFish', '', 53);
         $pdf->SetXY(30, 118);
         $pdf->Write(5, $ticket['order_id']);
         $pdf->SetXY(80, 118);
         $pdf->Write(5, $ticket['ticket_id']);
         $pdf->SetXY(120, 118);
         $pdf->Write(5, $ticket['security_code']);
         $pdf->Rect(15, 135, 180, 15, 'F');
         $pdf->SetTextColor(255);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 140);
         $pdf->Write(5, get_bloginfo('name'));
         $pdf->SetXY(104, 140);
//.........这里部分代码省略.........
开发者ID:mpaskew,项目名称:isc-dev,代码行数:101,代码来源:tribe-tickets.php

示例2: pdf_export_dots

function pdf_export_dots(&$dots, &$more)
{
    # PLEASE FOR TO BE CACHING ME, OBIWAN...
    # (20110120/straup)
    $w = 11;
    $h = 8.5;
    $margin = 0.5;
    $dpi = 72;
    $header_h = 0.2;
    $row_h = 0.2;
    $col_width = 1.25;
    # Here we go...
    $pdf = new FPDF("P", "in", array($w, $h));
    $pdf->setMargins($margin, $margin);
    # The legend gets added below (once we've figured out what page
    # each dot is on) but we'll just declare it here.
    $legend = array();
    $count_legend_items = floor($h / ($row_h * 1.4));
    $count_clusters = ceil(count($dots) / $count_legend_items);
    # Just turn clusters off for now... the map rendering time
    # is still too long for multiple map images (20110120/straup)
    $count_clusters = 1;
    $clusters = array();
    if ($count_clusters == 1) {
        $clusters = array($dots);
    } else {
        $points = array();
        $i = 0;
        foreach ($dots as $dot) {
            $points[] = array('x' => (double) $dot['longitude'], 'y' => (double) $dot['latitude'], 'id' => $dot['id'], 'idx' => $i);
            $i++;
        }
        $_clusters = kmeans_cluster($points, $count_clusters);
        foreach ($_clusters as $_cluster) {
            $_dots = array();
            foreach ($_cluster as $_pt) {
                $_dots[] = $dots[$pt['idx']];
            }
            $clusters[] = $_dots;
        }
    }
    #
    # First generate all the maps
    #
    $maps = array();
    $img_more = array('width' => $h * $dpi, 'height' => $h * $dpi, 'dot_size' => 15);
    foreach ($clusters as $dots) {
        list($map, $gd_img) = maps_image_for_dots($dots, $img_more);
        $maps[] = maps_gd_to_png($gd_img, 'pdf');
    }
    # Now figure out the what is the what of the dots
    $columns = array();
    $cols_per_page = floor(($w - $margin * 2) / $col_width);
    $count_cols = count($more['columns']);
    $pages_per_row = ceil($count_cols / $cols_per_page);
    # See this? We're adding enough extra columns and re-counting
    # everything in order to ensure that every page for each row
    # has an 'id' column
    if ($pages_per_row > 1) {
        $_count = $count_cols + ($pages_per_row - 1);
        $pages_per_row = ceil($_count / $cols_per_page);
    }
    # First, chunk out the header in (n) pages and measure the
    # height of the (header) row itself
    $_h = $header_h * 1.3;
    $pdf->SetFont('Helvetica', 'B', 10);
    for ($i = 0; $i < $count_cols; $i++) {
        $col_name = $more['columns'][$i];
        $b = floor($i / $cols_per_page);
        if (!is_array($columns[$b])) {
            $columns[] = array();
        }
        $columns[$b][] = $col_name;
        $str_width = ceil($pdf->GetStringWidth($more['columns'][$i]));
        if ($str_width > $col_width) {
            $lines = ceil($str_width / $col_width);
            $_h = max($_h, $lines * $header_h);
        }
    }
    $header_h = $_h;
    # make sure every page has an 'id' field
    # (see above)
    $count_columns = count($columns);
    for ($i = 0; $i < $count_columns; $i++) {
        $cols = $columns[$i];
        if (!in_array('id', $cols)) {
            array_unshift($cols, 'id');
            $columns[$i] = $cols;
        }
        # move stuff around so that we keep the pages nice and tidy
        if (count($columns[$i]) > $cols_per_page) {
            $to_keep = array_slice($columns[$i], 0, $cols_per_page);
            $extra = array_slice($columns[$i], $cols_per_page);
            $columns[$i] = $to_keep;
            $columns[$i + 1] = $extra;
        }
    }
    # Now work out the height of each row of dots
    $row_heights = array();
    $pdf->SetFont('Helvetica', '', 10);
//.........这里部分代码省略.........
开发者ID:netcon-source,项目名称:dotspotting,代码行数:101,代码来源:lib_pdf.php

示例3: GetStringWidth

 function GetStringWidth($s)
 {
     if ($this->CurrentFont['type'] == 'Type0') {
         return $this->GetMBStringWidth($s);
     } else {
         return parent::GetStringWidth($s);
     }
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:8,代码来源:korean.php

示例4: parse_pdf_content

function parse_pdf_content($content, $member_id)
{
    // parse text content from Smarty to pdf content
    global $db, $config, $t;
    $pdf_content = '';
    $margins = array(mm_to_pt(20), mm_to_pt(20), mm_to_pt(20), mm_to_pt(20));
    //left, top, right, bottom (in points) 56pt ~= 20mm
    $font_size = 14;
    //points
    $pdf = new FPDF('P', 'pt', 'A4');
    // portrait, A4
    $pdf->SetCompression(false);
    $pdf->SetMargins($margins[0], $margins[1], $margins[2]);
    //only left, top, right margins. bottom margin equals to 20mm by default.
    $pdf->SetTitle('Your Invoice');
    $pdf->SetSubject('*** Your Payment');
    $pdf->SetAuthor('aMember');
    $pdf->AddPage();
    $pdf->SetFont('Arial', '', $font_size);
    $current_x = $pdf->GetX();
    $current_y = $pdf->GetY();
    $width = mm_to_pt(210);
    $height = mm_to_pt(270);
    $width = $width - $margins[0] - $margins[2];
    // target width
    $height = $height - $margins[1] - $margins[3];
    // target height
    $image = $config['root_dir'] . "/logo.jpg";
    // logo path to include in pdf at top-right corner
    if (is_file($image)) {
        $size = getimagesize($image);
        $x = $width - $size[0] + $margins[0];
        $y = $current_y;
        $pdf->Image($image, $x, $y, $size[0], $size[1]);
        // use original size
        $current_y += $size[1];
    }
    $current_y += $font_size;
    //pt
    $contacts = explode("\n", $config['invoice_contacts']);
    // output contact information right-aligned
    $max_length = 0;
    foreach ($contacts as $row) {
        $row = trim($row);
        $length = $pdf->GetStringWidth($row);
        if ($length > $max_length) {
            $max_length = $length;
        }
    }
    $x = $width - $max_length + $margins[0];
    $y = $current_y;
    foreach ($contacts as $row) {
        $row = trim($row);
        $attr = get_font_styles($row);
        $pdf->SetFont('Arial', $attr, $font_size);
        $pdf->Text($x, $y, strip_tags($row));
        $y += $font_size;
    }
    $current_y = $y;
    $pdf->SetFont('Arial', '', $font_size);
    //return font settings
    // customer contacts
    $u = $db->get_user($member_id);
    if (!$t) {
        $t =& new_smarty();
    }
    $t->assign('u', $u);
    $cust_contacts = $t->fetch('mail_receipt_contact.pdf.txt');
    $cust_contacts = explode("\n", $cust_contacts);
    // output contact information left-aligned
    $num_rows = count($contacts);
    $x = $margins[0];
    $y = $current_y - $font_size * $num_rows;
    // $num_rows rows up from contact information and output customer data
    foreach ($cust_contacts as $row) {
        $row = trim($row);
        $attr = get_font_styles($row);
        $pdf->SetFont('Arial', $attr, $font_size);
        $pdf->Text($x, $y, strip_tags($row));
        $y += $font_size;
    }
    $current_y = $y;
    /*
    $y = $current_y - $font_size * 4; // 4 rows up from contact information and output customer data
    
    $string = $u['name_f'] . ' ' . $u['name_l'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    $string = $u['street'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    $string = $u['zip'] . ' ' . $u['city'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    	$state = db_getStateByCode($u['country'], $u['state']);
    	$country = db_getCountryByCode($u['country']);
    $string = $state .  ' '  . $country;
//.........这里部分代码省略.........
开发者ID:subashemphasize,项目名称:test_site,代码行数:101,代码来源:common.inc.php

示例5: pdfcreateAction


//.........这里部分代码省略.........
     if (Mage::getSingleton('customer/session')->isLoggedIn()) {
         $customer = Mage::getSingleton('customer/session')->getCustomer();
         $firstname = $customer->getFirstname();
     } else {
         $firstname = 'Customer';
     }
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 30, 'Dear ' . $firstname . ',', 0, 0, 'L');
     //$pdf->SetX(20);
     $pdf->SetY(80);
     $pdf->Cell(0, 1, 'Thank you for your interest in buying from us. Please find the below details of your selected products', 0, 0, 'L');
     $pdf->SetFont('arial', 'B', 8);
     //$pdf->SetX(10);
     $pdf->SetY(90);
     //$pdf->SetX(10);
     $pdf->Cell(7, 10, 'S.No', 1, 0, 'C');
     $pdf->Cell(100, 10, 'Products', 1, 0, 'L');
     $pdf->Cell(20, 10, 'SKU', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Price', 1, 0, 'C');
     $pdf->Image($indianrupee, 152, 94, 3, 2, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->Image($indianrupee, 197, 94, 3, 2, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->Cell(10, 10, 'Qty', 1, 0, 'C');
     $pdf->Cell(15, 10, 'Tax (%)', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Sub Total', 1, 1, 'L');
     $j = 1;
     foreach ($session as $item) {
         if (!$item->getParentItem()) {
             $i = 10;
             $pdf->SetFont('arial', '', 9);
             $product_name = wordwrap($item->getName(), 15, TRUE);
             $font_size = 14;
             $decrement_step = 0.1;
             $line_width = 100;
             while ($pdf->GetStringWidth($item->getName()) > 98) {
                 $pdf->SetFontSize($font_size -= $decrement_step);
             }
             $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getSku());
             $item_total = ceil($item->getPriceInclTax()) * $item->getQty();
             $product_total = ceil($product->getPrice()) * $item->getQty();
             $pdf->SetX(10);
             $pdf->Cell(7, $i, $j, 1, 0, 'C');
             $pdf->Cell($line_width, 10, $item->getName(), 1, 0, 'L');
             //$pdf->Cell(50,$i,$product_name, 1,0,'C');
             $pdf->Cell(20, $i, $item->getSku(), 1, 0, 'C');
             $pdf->Cell(20, $i, number_format($item->getPriceInclTax(), 2), 1, 0, 'C');
             $pdf->Cell(10, $i, $item->getQty(), 1, 0, 'C');
             if ($product->getTypeId() == 'bundle') {
                 $pdf->Cell(15, $i, '-', 1, 0, 'C');
             } else {
                 $pdf->Cell(15, $i, number_format($item['tax_percent'], 1), 1, 0, 'C');
             }
             $pdf->Cell(20, $i, number_format($item->getPriceInclTax() * $item->getQty(), 2), 1, 1, 'C');
             $total = $total + $item->getPriceInclTax() * $item->getQty();
             $saving = $saving + $product_total;
             $j++;
         }
     }
     $totals1 = Mage::getSingleton('checkout/session')->getQuote()->getTotals();
     $subtotal = $totals1["subtotal"]->getValue();
     $grandtotal = $totals1["grand_total"]->getValue();
     if (isset($totals1['discount']) && $totals1['discount']->getValue()) {
         $discount = number_format($totals1['discount']->getValue(), 2);
         //Discount value if applied
     }
     // exit;
     if ($total > $freeSubTotal) {
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:67,代码来源:CartController.php

示例6:

	if( $entente_tel==='1' )
	{

		$grandeur = '';
		$text_tel = '';

		if ( $tel_image != '' )
		{

			$a = $pdf->GetX();
			$b = $pdf->GetY();
			$ima = '../../images/imabulle/'.$tel_image.'.jpg';
			$valeurima=redimensionne_image($ima, 15, 15);
			$pdf->Image($ima, $a, $b, $valeurima[0], $valeurima[1]);
			$text_tel = '      '.$gepiSchoolTel;
			$grandeur = $pdf->GetStringWidth($text_tel);
			$grandeur = $grandeur + 2;

		}
		if ( $tel_texte != '' and $tel_image === '' )
		{

			$text_tel = $tel_texte.''.$gepiSchoolTel;
			$grandeur = $pdf->GetStringWidth($text_tel);

		}

		$pdf->Cell($grandeur,5, $text_tel,0,$passealaligne,'');

	}
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:bilan_absences_quotidien_pdf.php

示例7: die

 $mon_animal = $_POST['animal'];
 $medoc = $_POST['medoc'];
 $commentaire = $_POST['commentaire'];
 $horaires = $_POST['horaires'];
 $competences = $_POST['competences'];
 if (!file_exists($filename)) {
     if (!mkdir($filename, 0755, true)) {
         die('Echec lors de la création des répertoires...');
     }
 }
 $pdf = new FPDF();
 $pdf->AddPage();
 $pdf->SetFont('Times', '', 22);
 $pdf->Image('../image/logo/essai1.jpg', 10, 10, 50, 40);
 $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
 $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, $titre3, 0, 'C');
 $pdf->SetFont('Times', '', 18);
 $pdf->Ln();
 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
 $pdf->Ln();
 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
 $pdf->Ln(30);
 $pdf->SetFont('Times', '', 12);
 $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
 $pdf->Ln();
开发者ID:astrolabb,项目名称:aerogard3.2,代码行数:31,代码来源:labo.php

示例8:

 function text_width($size, $text)
 {
     if ($this->flash_font === NULL) {
         $this->error("No font specified.");
     }
     // end if
     parent::SetFont($this->flash_font, '', $size * $this->flash_font_size_conversion);
     return parent::GetStringWidth($text);
 }
开发者ID:joelphilippage,项目名称:Library,代码行数:9,代码来源:pdf_maker.php

示例9: foreach

 $pdf->Cell($avgw, $sh, 'Avg', 0, 1, 'C', 1);
 $y_coord += $sh;
 /** NOW FOR THE ASSIGNMENTS **/
 $pdf->SetFont('Times', '', 8);
 $pdf->SetXY($x_coord, $y_coord);
 $rcv = 1;
 foreach ($report['assignments'] as $grade) {
     if ($rcv % 2) {
         $pdf->SetFillColor(255, 255, 255);
     } else {
         $pdf->SetFillColor(238, 238, 238);
     }
     /** try to test for need to page break **/
     $lines = 1;
     if ($assignInfo['comment'] != '') {
         $lines += $pdf->GetStringWidth($assignInfo['comment']) / ($pw - $datew);
     }
     if ($y_coord + $sh * $lines > 10) {
         $pdf->AddPage();
         /** Page Title **/
         $pdf->SetTextColor(51, 102, 102);
         $pdf->SetFont('Times', 'B', $titlefs);
         $pdf->SetXY($lm, $tm);
         $pdf->Cell($headingw, $titleh, 'Questar III Student Progress Report (Contd.)', 0, 1, 'C', 0);
         $y_coord = $tm + $titleh;
         $pdf->SetXY($lm, $y_coord);
         $pdf->SetFont('Times', 'B', 10);
         $pdf->SetFillColor(192, 192, 192);
         $pdf->SetTextColor(0, 0, 0);
         $pdf->Cell($datew, $sh, 'Date', 0, 0, 'C', 1);
         $pdf->Cell($assignw, $sh, 'Assignment', 0, 0, 'C', 1);
开发者ID:knichel,项目名称:AIT,代码行数:31,代码来源:printview_progressreport.php

示例10: agregarEspaciosEnBlancoOnTextIndent

    /**
     * AGrega espacios en blancos segun el ancho en milimetros pasado como parametro
     */
    function agregarEspaciosEnBlancoOnTextIndent($text, $fontSize ,$mm_indent = 0) {
        if ($mm_indent == 0) return $text;
        
        // inicializo el FPDF para luego verificar el tamaño de la celda
        App::import('Vendor', 'fpdf/fpdf');
        $orientation = Configure::read('Fpdf.orientation');
        $unit = Configure::read('Fpdf.unit');
        $format = Configure::read('Fpdf.format');
        $fpdfAux = new FPDF();
        $fpdfAux->FPDF($orientation, $unit, $format);
        $fpdfAux->AddPage();

        $fpdfAux->SetFont(Configure::read('Fpdf.fontFamily'), '', $fontSize);
        
        $espacios = '';
        while ($mm_indent >=  $fpdfAux->GetStringWidth($espacios)){
            $espacios = $espacios.' ';
        }
        
        
        return $espacios.$text;
    }
开发者ID:alevilar,项目名称:gestionvilar,代码行数:25,代码来源:fpdf.php

示例11: Exception

     throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
 } else {
     $info_client = json_decode($info_client, true);
 }
 if (!file_exists($filename)) {
     if (!mkdir($filename, 0755, true)) {
         die('Echec lors de la création des répertoires...');
     }
 }
 $pdf = new FPDF();
 $pdf->AliasNbPages();
 $pdf->AddPage();
 $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
 $pdf->SetFont('Times', '', 18);
 $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
 $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, $titre3, 0, 'C');
 $pdf->Ln();
 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
 $pdf->Ln();
 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
 $pdf->Ln();
 $pdf->SetFont('Times', '', 12);
 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
 $pdf->SetX((210 - $w) / 2);
 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
开发者ID:astrolabb,项目名称:aerogard3.2,代码行数:31,代码来源:reglage.php

示例12: creation_resume

function creation_resume($animal_id, $info_analyse, $info_radio, $info_formulaire, $variable)
{
    $filename = '../sauvegarde/animaux/' . $animal_id;
    if (!file_exists($filename)) {
        if (!mkdir($filename, 0755, true)) {
            die('Echec lors de la création des répertoires...');
        }
    }
    $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login'])));
    if (empty($info_veto)) {
        throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
    } else {
        $info_veto = json_decode($info_veto, true);
    }
    if ($_SESSION['login'] != $_SESSION['login2']) {
        $info_veto2 = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login2'])));
        if (empty($info_veto2)) {
            throw new Exception("Erreur dans la recherche des informations sur le vétérinaire qui a réalisé la consultation");
        } else {
            $info_veto2 = json_decode($info_veto2, true);
        }
    }
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
    $pdf->SetFont('Times', '', 18);
    $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
    $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, $titre3, 0, 'C');
    $pdf->Ln();
    $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
    $pdf->Ln();
    $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
    $pdf->Ln();
    $pdf->SetFont('Times', '', 12);
    $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
    $pdf->Ln(20);
    $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
    $pdf->SetFont('Times', 'B', 12);
    $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Résumé de la consultation du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L');
    $pdf->SetFont('Times', '', 12);
    if ($_SESSION['login'] != $_SESSION['login2']) {
        $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Cette consultation a été réalisée par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L');
        $pdf->Ln();
    }
    $pdf->SetFont('Times', '', 14);
    $pdf->SetFillColor(153, 153, 153);
    $pdf->SetTextColor(0, 0, 0);
    $pdf->SetDrawColor(153, 153, 153);
    $pdf->SetLineWidth(0.3);
    $pdf->MultiCell(190, 10, requetemysql::gestion_string_maj("Motif de consultation :" . $info_formulaire['barre_resume']), '0', 'L', true);
    $pdf->Ln();
    $pdf->SetFont('Times', '', 12);
    $pdf->MultiCell(190, 5, requetemysql::gestion_string_maj("Détail :" . $info_formulaire['clinique']), 0, 'L');
    $pdf->Ln(15);
    $pdf->Cell(50, 20, utf8_decode("signature du vétérinaire :"), 0, 0, false);
    if (count($info_analyse) > 0) {
        $pdf->AddPage();
        $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
        $pdf->SetFont('Times', '', 18);
        $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
        $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, $titre3, 0, 'C');
        $pdf->Ln();
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
        $pdf->Ln();
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
        $pdf->Ln();
        $pdf->SetFont('Times', '', 12);
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
        $pdf->Ln(20);
        $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
        $pdf->SetFont('Times', 'B', 12);
        $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Résultat d'analyse du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L');
        $pdf->SetFont('Times', '', 12);
        if ($_SESSION['login'] != $_SESSION['login2']) {
            $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Ces analyses ont été réalisées par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L');
        }
        $pdf->Ln();
        // Largeurs des colonnes
        $w = array(190 / 4, 190 / 6, 190 / 6, 190 / 4, 190 / 6);
        $header = array(utf8_decode('Référence'), utf8_decode('Résultat'), utf8_decode('Unité'), utf8_decode('Méthode'), utf8_decode("date d'analyse"));
        // En-tête
        for ($i = 0; $i < count($header); $i++) {
            $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C');
        }
//.........这里部分代码省略.........
开发者ID:astrolabb,项目名称:aerogard3.2,代码行数:101,代码来源:nouvelleconsultation.php

示例13:

     semi_log(2);
     break;
     // Génération papier semi-log a 5 modules
 // Génération papier semi-log a 5 modules
 case 14:
     semi_log(5);
     break;
     // En cas de problème, affichage d'une page d'erreur
 // En cas de problème, affichage d'une page d'erreur
 default:
     $pdf->AddPage();
     $pdf->Image('images/logo_erreur.png', 30, 30, 20);
     $pdf->Image('images/logo_erreur.png', 160, 30, 20);
     $pdf->SetFont('Arial', 'B', 48);
     $pdf->SetTextColor(255, 0, 0);
     $largeur = $pdf->GetStringWidth('ERREUR');
     $pos = 105 - $largeur / 2;
     $pdf->Text($pos, 45, 'ERREUR');
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('Arial', '', 12);
     $largeur = $pdf->GetStringWidth($date);
     $pos = 105 - $largeur / 2;
     $pdf->Text($pos, 50, $date);
     $pdf->Image('images/logo_info.png', 30, 60, 20);
     $pdf->Image('images/logo_info.png', 160, 60, 20);
     $pdf->SetTextColor(0, 0, 255);
     $largeur = $pdf->GetStringWidth('Le papier que vous avez sélectionné n\'existe pas...');
     $pos = 105 - $largeur / 2;
     $pdf->Text($pos, 70, 'Le papier que vous avez sélectionné n\'existe pas...');
     $largeur = $pdf->GetStringWidth('Imprimez ce document, puis déposez-le dans mon casier.');
     $pos = 105 - $largeur / 2;
开发者ID:BackupTheBerlios,项目名称:openphysic-svn,代码行数:31,代码来源:gen_papier.php

示例14: FPDF

$pdf = new FPDF();
for ($i = 0; $i < $size; $i++) {
    switch ($option) {
        default:
            redirect_header("javascript:history.go(-1)", 2, _PM_REDNON);
            break;
        case "pdf_messages":
            $pm_handler =& xoops_gethandler('priv_msgs');
            $pm =& $pm_handler->get($msg_id[$i]);
            $pdf_data['title'] = utf8_decode(Chars($pm->getVar('subject')));
            $pdf_data['content'] = utf8_decode(Chars($pm->getVar('msg_text')));
            $pdf_data['date'] = formatTimestamp($pm->getVar('msg_time'));
            $pdf_data['author'] = XoopsUser::getUnameFromId($pm->getVar('from_userid'));
            $pdf->AddPage();
            $pdf->SetFont('Arial', 'B', 15);
            $w = $pdf->GetStringWidth($pdf_data['title']) + 6;
            $pdf->SetX((210 - $w) / 2);
            $pdf->SetDrawColor(204, 204, 204);
            $pdf->SetFillColor(0, 0, 0);
            $pdf->SetLineWidth(0.2);
            $pdf->SetTextColor(255, 255, 255);
            $pdf->Cell($w, 8, Chars($pdf_data['title']), 1, 1, 'C', true);
            $pdf->Ln(6);
            // date
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetTextColor(0, 0, 0);
            $pdf->SetFillColor(255, 255, 255);
            $pdf->MultiCell(40, 8, chars(_MP_TRI_DATE) . ': ' . $pdf_data['date'], 1, 1, 'L', true);
            $pdf->Ln(6);
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetFillColor(239, 239, 239);
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:makepdf.php

示例15: update_pdf_sizings

 /**
  * Updates the PDF sizing information based on the current row of data
  *
  * @param  FPDF                 $newpdf      The PDF object we are creating
  * @param  stdClass             $datum       The current row of data
  * @param  array                $widths      Mapping of columns to widths
  * @param  array                $heights     Mapping of rows to heights
  * @param  id                   $row         Index of current row
  * @param  int array reference  $min_widths  Update with minimum column widths based on longest token
  */
 protected function update_pdf_sizings($newpdf, $datum, &$widths, &$heights, $row, &$min_widths)
 {
     if (!isset($heights[$row])) {
         $heights[$row] = 0;
     }
     //perform the calculation column-by-column
     foreach ($this->report->headers as $id => $header) {
         if (in_array(php_report::$EXPORT_FORMAT_PDF, $this->report->columnexportformats[$id])) {
             $effective_id = $this->report->get_object_index($id);
             if (isset($datum->{$effective_id})) {
                 $width = $newpdf->GetStringWidth(trim(strip_tags($datum->{$effective_id}))) + self::horizontal_buffer;
                 //update the width if applicable
                 if ($width > $widths[$id]) {
                     $lines = ceil($width / $widths[$id]);
                     $widths[$id] = $width;
                 } else {
                     $lines = 1;
                 }
                 $height = $lines * 0.2;
                 //update the height if applicable
                 if ($height > $heights[$row]) {
                     $heights[$row] = $height;
                 }
                 //update min width if appropriate
                 $min_width = $this->get_min_string_width($newpdf, trim(strip_tags($datum->{$effective_id})));
                 if ($min_width > $min_widths[$id]) {
                     $min_widths[$id] = $min_width;
                 }
             }
         }
     }
 }
开发者ID:remotelearner,项目名称:elis.reporting,代码行数:42,代码来源:php_report_export_pdf.class.php


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