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


PHP PDF::GetStringWidth方法代码示例

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


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

示例1: GetStringWidth

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

示例2:

 /**
  *   Affiche la grille des lignes de factures
  *
  *   @param     PDF			$pdf     		Object PDF
  *   @param		int			$tab_top		Tab top
  *   @param		int			$tab_height		Tab height
  *   @param		int			$nexY			next y
  *   @param		Translate	$outputlangs	Output langs
  *   @return	void
  */
 function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
 {
     global $conf;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     // Amount in (at tab_top - 1)
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('', '', $default_font_size - 2);
     $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency" . $conf->currency));
     $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 4), $tab_top - 4);
     $pdf->MultiCell($pdf->GetStringWidth($titre) + 3, 2, $titre);
     $pdf->SetDrawColor(128, 128, 128);
     // Rect prend une longueur en 3eme param
     $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
     // line prend une position y en 3eme param
     $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
     $pdf->SetFont('', '', 8);
     // Accountancy piece
     $pdf->SetXY($this->posxpiece - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxdesc - $this->posxpiece - 1, 1, '', '', 'R');
     // Comments
     $pdf->line($this->posxdesc - 1, $tab_top, $this->posxdesc - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxdate - $this->posxdesc - 1, 1, $outputlangs->transnoentities("Description"), '', 'L');
     // Date
     $pdf->line($this->posxdate - 1, $tab_top, $this->posxdate - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxdate - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxtype - $this->posxdate - 1, 2, $outputlangs->transnoentities("Date"), '', 'C');
     // Type
     $pdf->line($this->posxtype - 1, $tab_top, $this->posxtype - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxtype - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxprojet - $this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
     // Project
     $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C');
     // VAT
     if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
         $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
         $pdf->SetXY($this->posxtva - 1, $tab_top + 1);
         $pdf->MultiCell($this->posxup - $this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C');
     }
     // Unit price
     $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxup - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceU"), '', 'C');
     // Quantity
     $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
     $pdf->MultiCell($this->postotalttc - $this->posxqty, 2, $outputlangs->transnoentities("Qty"), '', 'R');
     // Total with all taxes
     $pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height);
     $pdf->SetXY($this->postotalttc - 1, $tab_top + 1);
     $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc, 2, $outputlangs->transnoentities("TotalTTC"), '', 'R');
     $pdf->SetTextColor(0, 0, 0);
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:65,代码来源:pdf_standard.modules.php

示例3: getWidth

 /**
  * Splits the text into lines to fit into a giving cell
  * and returns the last lines width
  *
  * @param PDF $pdf
  *
  * @return array
  */
 function getWidth($pdf)
 {
     // Setup the style name, a font must be selected to calculate the width
     $pdf->setCurrentStyle("footnotenum");
     // Check for the largest font size in the box
     $fsize = $pdf->getCurrentStyleHeight();
     if ($fsize > $pdf->largestFontHeight) {
         $pdf->largestFontHeight = $fsize;
     }
     // Returns the Object if already numbered else false
     if (empty($this->num)) {
         $pdf->checkFootnote($this);
     }
     // Get the line width
     $lw = ceil($pdf->GetStringWidth($this->numText));
     // Line Feed counter - Number of lines in the text
     $lfct = substr_count($this->numText, "\n") + 1;
     // If there is still remaining wrap width...
     if ($this->wrapWidthRemaining > 0) {
         // Check with line counter too!
         // but floor the $wrapWidthRemaining first to keep it bugfree!
         $wrapWidthRemaining = (int) $this->wrapWidthRemaining;
         if ($lw >= $wrapWidthRemaining or $lfct > 1) {
             $newtext = "";
             $lines = explode("\n", $this->numText);
             // Go throught the text line by line
             foreach ($lines as $line) {
                 // Line width in points
                 $lw = ceil($pdf->GetStringWidth($line));
                 // If the line has to be wraped
                 if ($lw >= $wrapWidthRemaining) {
                     $words = explode(" ", $line);
                     $addspace = count($words);
                     $lw = 0;
                     foreach ($words as $word) {
                         $addspace--;
                         $lw += ceil($pdf->GetStringWidth($word . " "));
                         if ($lw < $wrapWidthRemaining) {
                             $newtext .= $word;
                             if ($addspace != 0) {
                                 $newtext .= " ";
                             }
                         } else {
                             $lw = $pdf->GetStringWidth($word . " ");
                             $newtext .= "\n{$word}";
                             if ($addspace != 0) {
                                 $newtext .= " ";
                             }
                             // Reset the wrap width to the cell width
                             $wrapWidthRemaining = $this->wrapWidthCell;
                         }
                     }
                 } else {
                     $newtext .= $line;
                 }
                 // Check the Line Feed counter
                 if ($lfct > 1) {
                     // Add a new line feed as long as it’s not the last line
                     $newtext .= "\n";
                     // Reset the line width
                     $lw = 0;
                     // Reset the wrap width to the cell width
                     $wrapWidthRemaining = $this->wrapWidthCell;
                 }
                 $lfct--;
             }
             $this->numText = $newtext;
             $lfct = substr_count($this->numText, "\n");
             return array($lw, 1, $lfct);
         }
     }
     $l = 0;
     $lfct = substr_count($this->numText, "\n");
     if ($lfct > 0) {
         $l = 2;
     }
     return array($lw, $l, $lfct);
 }
开发者ID:jacoline,项目名称:webtrees,代码行数:86,代码来源:PDF_Footnote.php

示例4:

     $pdf->Cell($br01, $zelle, JText::_('TOURNAMENT_RANKABB'), 1, 0, 'C', 1);
     if ($turParams->get('displayPlayerSnr', 1) == 1) {
         $pdf->Cell($br02, $zelle, JText::_('TOURNAMENT_NUMBERABB'), 1, 0, 'C', 1);
     }
     $pdf->Cell($br03, $zelle, JText::_('TOURNAMENT_PLAYERNAME'), 1, 0, 'L', 1);
     $pdf->Cell($br04, $zelle, JText::_('TOURNAMENT_TWZ'), 1, 0, 'C', 1);
     for ($rnd = 1; $rnd <= $this->turnier->runden; $rnd++) {
         $pdf->Cell($br11, $zelle, $rnd, 1, 0, 'C', 1);
     }
     $pdf->Cell($br91, $zelle, JText::_('TOURNAMENT_POINTS_ABB'), 1, 0, 'C', 1);
     // mgl. Feinwertungen
     for ($f = 1; $f <= 3; $f++) {
         $fwFieldName = 'tiebr' . $f;
         if ($this->turnier->{$fwFieldName} > 0) {
             $czelle = JText::_('TOURNAMENT_TIEBR_ABB_' . $this->turnier->{$fwFieldName});
             if ($pdf->GetStringWidth($czelle) > $br92) {
                 $czelle = JText::_('TOURNAMENT_TIEBR_ABB_' . $this->turnier->{$fwFieldName} . '_PDF');
             }
             $pdf->Cell($br92, $zelle, $czelle, 1, 0, 'C', 1);
         }
     }
     $pdf->Cell(1, $zelle, " ", 0, 1, 'C');
 }
 // Anzahl der Teilnehmer durchlaufen
 $pdf->SetFont('Times', '', $font);
 $pdf->SetTextColor(0);
 if ($p1 == false) {
     $p1 = true;
     $pdf->SetFillColor(255);
 } else {
     $p1 = false;
开发者ID:ChessLeagueManager,项目名称:deprecated,代码行数:31,代码来源:rangliste_pdf.php

示例5: PDF

<?php

require 'mc_indent.php';
$InterLigne = 7;
$pdf = new PDF();
$pdf->AddPage();
$pdf->SetMargins(30, 10, 30);
$pdf->SetFont('Arial', '', 12);
$txt = "Cher Pierre";
$txtLen = $pdf->GetStringWidth($txt);
$milieu = (210 - $txtLen) / 2;
$pdf->SetX($milieu);
$pdf->Write(5, $txt);
$pdf->ln(30);
$txt = "Voici venu le temps pour toi de renouveler ta licence-assurance, en effet celle-ci expire le 28/9 prochain. Tu trouveras joint à ce document le certificat d'aptitude à faire remplir par le médecin.";
$pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15);
$pdf->ln(10);
$txt = "Je me permets de te rappeler que cette licence est obligatoire et nécessaire à la pratique de notre sport favori, tant à l'occasion de nos entraînements qu'à toutes autres manifestations auxquelles tu peux participer telles que compétitions, cours fédéraux ou visites amicales dans un autre club.";
$pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15);
$pdf->ln(10);
$txt = "Dès lors, je te saurais gré de bien vouloir me retourner le certificat d'aptitude dûment complété par le médecin accompagné de ton paiement de 31 € ou de la preuve de celui-ci par virement bancaire. Le tout dans les plus brefs délais afin de ne pas interrompre la couverture de ladite assurance et par la même occasion de t'empêcher de participer à nos cours le temps de la régularisation. Il y va de ta sécurité.";
$pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15);
$pdf->ln(10);
$txt = "Merci de la confiance que tu mets en notre club pour ton épanouissement sportif.";
$pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15);
$pdf->ln(10);
$txt = "Le comité";
$pdf->MultiCell(0, $InterLigne, $txt, 0, 'R', 0);
$pdf->Output();
开发者ID:rohmad-st,项目名称:fpdf,代码行数:29,代码来源:ex.php

示例6: automaticSummaryInPDF

 function automaticSummaryInPDF($submission)
 {
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $articleDrugInfoDao =& DAORegistry::getDAO('ArticleDrugInfoDAO');
     $extraFieldDAO =& DAORegistry::getDAO('ExtraFieldDAO');
     $journal =& Request::getJournal();
     $submitter =& $submission->getUser();
     $title = $journal->getJournalTitle();
     $articleTexts = $submission->getArticleTexts();
     $articleTextLocales = $journal->getSupportedLocaleNames();
     $secIds = $submission->getArticleSecIds();
     $details = $submission->getArticleDetails();
     $purposes = $submission->getArticlePurposes();
     $articlePrimaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_PRIMARY);
     $articleSecondaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_SECONDARY);
     $coutryList = $countryDao->getCountries();
     $articleDrugs = $submission->getArticleDrugs();
     $pharmaClasses = $articleDrugInfoDao->getPharmaClasses();
     $drugStudyClasses = $articleDrugInfoDao->getClassKeysMap();
     $articleSites = $submission->getArticleSites();
     $expertisesList = $extraFieldDAO->getExtraFieldsList(EXTRA_FIELD_THERAPEUTIC_AREA, EXTRA_FIELD_ACTIVE);
     $fundingSources = $submission->getArticleFundingSources();
     $pSponsor = $submission->getArticlePrimarySponsor();
     $sSponsors = $submission->getArticleSecondarySponsors();
     $CROs = $submission->getArticleCROs();
     $contact = $submission->getArticleContact();
     Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER));
     import('classes.lib.tcpdf.pdf');
     import('classes.lib.tcpdf.tcpdf');
     $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor($submitter->getFullName());
     $pdf->SetTitle($title);
     $subject = $submission->getProposalId() . ' - ' . Locale::translate('submission.summary');
     $pdf->SetSubject($subject);
     $cell_width = 45;
     $cell_height = 6;
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, 58, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $pdf->AddPage();
     // Title
     $pdf->SetFont('Times', 'B', 15);
     $w = $pdf->GetStringWidth($title) + 6;
     $pdf->SetX((210 - $w) / 2);
     $pdf->Cell($w, 9, $title, 0, 1, 'C');
     // sub-title
     $pdf->SetFont('Times', 'BI', 14);
     $w2 = $pdf->GetStringWidth($subject) + 6;
     $pdf->SetX((210 - $w2) / 2);
     $pdf->Cell($w2, 9, $subject, 0, 1, 'C');
     // Line break
     $pdf->Ln(10);
     // Main Info
     $pdf->SetFont('Times', '', 12);
     $pdf->MultiRow(50, Locale::translate("common.proposalId"), $submission->getProposalId(), 'L');
     $pdf->MultiRow(50, Locale::translate("article.title"), $submission->getScientificTitle(), 'L');
     $pdf->MultiRow(50, Locale::translate("submission.submitter"), $submitter->getFullName(), 'L');
     $pdf->MultiRow(50, Locale::translate("common.dateSubmitted"), $submission->getDateSubmitted(), 'L');
     // Line break
     $pdf->Ln(10);
     //CT Information
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'I' . Locale::translate('common.queue.long.articleDetails', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     $pdf->SetFont('Times', '', 12);
     $scientificTitle = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$scientificTitle) {
             $pdf->MultiRow(50, Locale::translate("proposal.scientificTitle"), $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $scientificTitle = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $publicTitle = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$publicTitle) {
             $pdf->MultiRow(50, Locale::translate("proposal.publicTitle"), $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $publicTitle = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $firstSecId = null;
     foreach ($secIds as $secId) {
         if (!$firstSecId) {
//.........这里部分代码省略.........
开发者ID:elavaud,项目名称:hrp_ct,代码行数:101,代码来源:Action.inc.php

示例7: elseif

     $pdf->Cell($w[3], $pdf->tabletextheight, $document_no, 0, 0, 'L');
     if ($bpartner_id > 0 && $acc->account_type != 2 && $acc->account_type != 3) {
         $displayname = $bpartner_name;
     } elseif ($refbpartner_id && $acc->account_type != 2 && $acc->account_type != 3) {
         $displayname = $refbpartner_name;
     } else {
         $displayname = $refaccounts_name;
     }
     //$displayname=$bpartner_name."$linedesc";
     if (strpos($displayname, "Cash At") !== false) {
         $displayname = "";
         //$chequeno="";
         $linedesc = $row['linedesc'];
     }
     $dn = $displayname . $linedesc;
     while ($pdf->GetStringWidth($dn) > $w[4]) {
         $dn = substr_replace($dn, "", -1);
     }
     if ((int) $balanceamt == 0) {
         $balanceamt = 0;
     }
     $pdf->Cell($w[4], $pdf->tabletextheight, "{$dn}", 0, 0, 'L');
     $pdf->Cell($w[5], $pdf->tabletextheight, $debitamt, 0, 0, 'R');
     $pdf->Cell($w[6], $pdf->tabletextheight, $creditamt, 0, 0, 'R');
     $pdf->Cell($w[7], $pdf->tabletextheight, number_format($balanceamt, 2), 0, 0, 'R');
     $pdf->Ln();
     $i++;
 }
 if ((int) $balanceamt == 0) {
     $balanceamt = 0;
 }
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:31,代码来源:viewsingleledger.php

示例8: PDF

 /**
  * print_PDF prints the Repertory result table in an PDF file.
  *
  * @param string $task 'save_PDF'|'print_PDF': if 'save_PDF' the PDF should get downloaded, if 'print_PDF' the PDF should open in the browser
  * @return void
  * @access public
  */
 function print_PDF($task)
 {
     global $session;
     if ($task == 'save_PDF') {
         $dest = 'D';
     } else {
         $dest = 'I';
     }
     if ($session->lang == 'de') {
         $date = $this->date_to_german($this->date);
     } else {
         $date = $this->date;
     }
     $pdf = new PDF('L');
     $pdf->SetTopMargin(20);
     $pdf->SetFont('Arial', '', 12);
     $pdf->SetTitle(_("Repertorization result"), true);
     $pdf->SetAuthor(_("OpenHomeopath"), true);
     $pdf->SetCreator(_("openhomeo.org"), true);
     $pdf->AddPage();
     $w1 = $pdf->GetStringWidth(_('Patient:') . '  ' . _('Rep.-Date:') . '  ');
     $w3 = $pdf->GetStringWidth(_('Case taking:') . '  ');
     $w4 = $pdf->GetStringWidth(_('Prescription:') . '  ' . _('Rep.-No.:') . '  ');
     $pdf->SetFont('', 'B');
     $w2 = $pdf->GetStringWidth(iconv('UTF-8', 'windows-1252', $this->patient) . $date . $date);
     $pdf->SetFont('', '');
     $pdf->write(7, _('Patient:') . '  ');
     $pdf->SetFont('', 'B');
     $pdf->write(7, iconv('UTF-8', 'windows-1252', $this->patient));
     $pdf->SetFont('', '');
     // Move to the right
     $pdf->Cell(295 - ($w1 + $w2));
     $pdf->Cell(0, 7, _('Rep.-Date:') . '  ');
     $pdf->SetFont('', 'B');
     $pdf->Cell(0, 7, $date, 0, 1, 'R');
     $pdf->SetFont('', '');
     $pdf->write(7, _('Prescription:') . '  ');
     $pdf->SetFont('', 'B');
     $pdf->write(7, iconv('UTF-8', 'windows-1252', $this->prescription));
     if (!empty($this->rep_id)) {
         $pdf->SetFont('', '');
         // Move to the right
         $pdf->Cell(295 - ($w1 + $w2));
         $pdf->Cell(0, 7, _('Rep.-No.:') . '  ');
         $pdf->SetFont('', 'B');
         $pdf->Cell(0, 7, $this->rep_id, 0, 1, 'R');
     } else {
         $pdf->Ln(7);
     }
     $pdf->SetFont('', '');
     $pdf->write(7, _('Case taking:') . '  ');
     $pdf->SetFont('', 'I', 11);
     $pdf->Cell(0, 1, "", 0, 2);
     $note_ar = explode("%br", $this->note);
     foreach ($note_ar as $note_line) {
         $pdf->Cell(0, 5, iconv('UTF-8', 'windows-1252', $note_line), 0, 2);
     }
     // Line break
     $pdf->Ln(10);
     $header_ar = array();
     $first_row_ar = array();
     $data_ar = array();
     $this->get_table_data($header_ar, $first_row_ar, $data_ar, $summary);
     $pdf->create_result_table($header_ar, $first_row_ar, $data_ar, 70);
     $pdf->SetFont('Arial', '', 10);
     $pdf->Ln(5);
     $pdf->write(7, iconv('UTF-8', 'windows-1252', $summary));
     $pdf->Output("OpenHomeopath_" . _("Repertorization result") . "_" . date("Y-m-d_H-i") . ".pdf", $dest);
 }
开发者ID:sudheertest,项目名称:OpenHomeopath,代码行数:76,代码来源:rep_class.php

示例9: strlen

 $price_value = EMPTY_STRING;
 $tax_name = EMPTY_STRING;
 $tax_value = EMPTY_STRING;
 $pdf->SetFont($pdf->font, BOLD, $pdf->invoice_font_size);
 for ($i = 0; $i < $total_items; $i++) {
     $key = $total_price_classes[$i];
     if ($add_tax_id) {
         $tax = $total_tax[$i];
         $tax_id_len = strlen($tax);
         if ($tax_id_len < $max_tax_id_len) {
             //Add leading blanks
             $tax = str_pad(EMPTY_STRING, $max_tax_id_len - $tax_id_len, BLANK) . $tax;
         }
         $tax .= '(' . $tax . ' %)' . COLON_BLANK;
         $s = PRINT_INVOICE_SUM . $tax;
         $max_text_len = max($max_text_len, ceil($pdf->GetStringWidth($s)));
         if ($tax_name) {
             $tax_name .= TILDE;
             $tax_value .= TILDE;
         }
         $tax_name .= $s;
         $tax_value .= olc_format_price($total_tax[$key], 1, 1, 0);
     }
     $s = PRINT_INVOICE_SUM . $tax;
     $max_text_len = max($max_text_len, ceil($pdf->GetStringWidth($s)));
     $pdf->SetFont($pdf->font, NORMAL, $pdf->invoice_font_size);
     if ($price_name) {
         $price_name .= TILDE;
         $price_value .= TILDE;
     }
     $price_name .= $s;
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:pdf_invoice.php

示例10: PDF

$pdf = new PDF();
//set document properties
$pdf->SetAuthor('Anon');
$pdf->SetTitle($techName);
//set font for the entire document
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage('P');
//$pdf->SetDisplayMode(real,'default');
//**Insert an image**
$pdf->Image('images/be_creative.png', 10, 10, 40, 0);
//**Display the title without a border around it**
$pdf->SetFontSize(16);
// Check width of title and deal with titles that are more than one line
$w = $pdf->GetStringWidth($techName);
if ($w > 162) {
    $pdf->SetXY(15, 25);
    $pdf->MultiCell(170, 7, $techName, 0, 'C', 0);
    $pdf->Ln(10);
} else {
    $pdf->SetXY(50, 25);
    $pdf->Cell(100, 10, $techName, 0, 0, 'C', 0);
    $pdf->Ln(15);
}
//**Display "What is" heading**
$pdf->SetFontSize(14);
$pdf->Cell(100, 10, "What is " . $techName . "?", 0, 0, 'L', 0);
// Line break
$pdf->Ln(10);
$pdf->SetFont('Arial', '', 10);
开发者ID:JLockerbie,项目名称:BC,代码行数:31,代码来源:techniquePDF.php

示例11: while

 if (isset($einzel[$w]->paar) and $einzel[$w]->paar == $y + 1) {
     // Bretter
     for ($x = 0; $x < $liga[0]->stamm; $x++) {
         if ($x % 2 != 0) {
             $zeilenr = zeile1;
         } else {
             $zeilenr = zeile2;
         }
         if (!$cr) {
             $pdf->SetX($xx1);
         } else {
             $pdf->SetX($xx2);
         }
         $breite2 = 4;
         $breite1 = 38;
         if ($pdf->GetStringWidth($einzel[$w]->hsnr) > $breite2) {
             $breite2 = $pdf->GetStringWidth($einzel[$w]->hsnr) + 1;
             $breite1 = $breite1 + 4 - $pdf->GetStringWidth($einzel[$w]->hsnr) - 1;
         }
         $pdf->Cell($breite2, $zelle, $einzel[$w]->hsnr, 'L', 0);
         $htext = utf8_decode($einzel[$w]->hname);
         if ($htext == '') {
             $htext = utf8_decode(JText::_('RESULTS_DETAILS_NOT_NOMINATED'));
         }
         if ($pdf->GetStringWidth($htext) > $breite1) {
             while ($pdf->GetStringWidth($htext) > $breite1) {
                 $htext = substr($htext, 0, -1);
             }
             $pdf->Cell($breite1, $zelle, $htext, 0, 0, 'L');
         } else {
             $pdf->Cell($breite1, $zelle, $htext, 0, 0, 'L');
开发者ID:ChessLeagueManager,项目名称:deprecated,代码行数:31,代码来源:runde_pdf.php

示例12:

global $USER;
$USER->username;
$USER->firstname;
$USER->lastname;
$USER->password;
$fullname = $USER->firstname . " " . $USER->lastname;
$email = $USER->email;
$fullname = utf8_decode($fullname);
$pdf->SetFont("Arial", "", 12);
$pdf->SetTextColor(0, 0, 0);
//$pdf->Text(80,290,$fullname);
$mid_x = 100;
// the middle of the "PDF screen", fixed by now.
$text = $fullname;
$text1 = $email;
$pdf->Text($mid_x - $pdf->GetStringWidth($text) / 2, 290, $text);
$pdf->Text($mid_x - $pdf->GetStringWidth($text1) / 2, 295, $text1);
if ($pdf->numPages > 1) {
    for ($i = 2; $i <= $pdf->numPages; $i++) {
        //$pdf->endPage();
        $pdf->_tplIdx = $pdf->importPage($i);
        $pdf->AddPage();
        $pdf->SetFont("Arial", "", 12);
        $pdf->SetTextColor(0, 0, 0);
        //$pdf->Text(80,290,$fullname);
        $pdf->Text($mid_x - $pdf->GetStringWidth($text) / 2, 290, $text);
        $pdf->Text($mid_x - $pdf->GetStringWidth($text1) / 2, 295, $text1);
    }
}
//$pdf->Output();
$pdf->Output("sample.pdf");
开发者ID:VinicioSantos,项目名称:PDFMoodleEditor,代码行数:31,代码来源:test.php

示例13:

     $idcat2 = $idcat;
     $pdf->AddPage();
     $x = 15.202;
     $y = 36.617;
 }
 if ($i % 3 == 0 && $i % 9 != 0) {
     $x = 15.202;
     $y += 76.268;
 }
 $pdf->ImageCenter("../" . $fila->imgpath, $x + $border, $y + $border, $w, $imgh);
 $codigo = $fila->codigo;
 if ($codigo != null) {
     $txt = utf8_decode("Código: " . $codigo);
     $pdf->SetFont('Arial', 'B', 8);
     $pdf->SetFillColor(255);
     $stringw = $pdf->GetStringWidth($txt);
     $pdf->setXY($x + $border + $w - $stringw, $y + $border + $imgh - 3);
     $pdf->Cell($stringw, 3, $txt, 0, 0, 'C', true);
 }
 $cellh = 3.6085;
 if (strcasecmp($fila->distincion, "no") == 0) {
     $txt = $fila->nombre;
 } else {
     $txt = $fila->nombre . " " . $fila->distincion . " " . $fila->descripcion;
 }
 $txt = utf8_decode($txt);
 $pdf->SetFont('Arial', '', 10);
 $pdf->SetXY($x + $border, $y + $border + $imgh);
 $pdf->MultiCell($w, 3.6085, $txt, 0, 'C');
 $pdf->Ln();
 $pdf->SetX($x);
开发者ID:StockersSRL,项目名称:Lucas,代码行数:31,代码来源:catalogo.php

示例14: array

     $periodamt2 = number_format($periodamt[9], 2);
     $periodamt1 = number_format($periodamt[10], 2);
     $periodamt0 = number_format($periodamt[11], 2);
 }
 $pdf->total_balance += $balance_amt;
 $rowdata = array($bp->bpartner_no, $bp->bpartner_name, $periodamt5, $periodamt4, $periodamt3, $periodamt2, $periodamt1, $periodamt0, number_format($balance_amt, 2), $bp->bpartner_tel_1);
 $rowdata2 = array("", "", $periodamt11, $periodamt10, $periodamt9, $periodamt8, $periodamt7, $periodamt6, "", "");
 if ($pdf->y + 10 > $pdf->PageBreakTrigger && !$pdf->InFooter && $pdf->AcceptPageBreak()) {
     $pdf->AddPage($pdf->CurOrientation);
 }
 $k = 0;
 foreach ($rowdata as $c) {
     if ($c == "0.00" && $k < 8) {
         $c = "-";
     }
     while ($pdf->GetStringWidth($c) > $w1[$k]) {
         $c = substr_replace($c, "", -1);
     }
     if ($statementpapersource == 0) {
         $pdf->Cell($w0[$k], $defaultfontheight, $c, $tableheadertype, 0, $headeralign[$k]);
     } else {
         $pdf->Cell($w1[$k], $defaultfontheight, $c, $tableheadertype, 0, $headeralign[$k]);
     }
     // print for letter
     $k++;
 }
 $pdf->Ln();
 $k = 0;
 foreach ($rowdata2 as $c) {
     if ($c == "0.00" && $k < 8) {
         $c = "-";
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:31,代码来源:viewagingstatement.php

示例15: while

 $pdf->SetFont('Times', 'BU', $font + 1);
 $pdf->Cell(10, $zelle, $x + 1, 0, 0, 'C');
 $pdf->Cell(60, $zelle, utf8_decode($mannschaft[$x]->name), 0, 0, 'L');
 $pdf->SetFont('Times', '', $font);
 $zn++;
 if ($liga[0]->anzeige_ma == 1) {
     $pdf->Cell(80, 8, utf8_decode(JText::_('TEAM_FORMATION_BLOCKED')), 0, 0, 'C');
 }
 if ($count[$zl]->mgl_nr !== '0' && $zn <= $liga[0]->stamm && $count[$zl]->tln_nr == $mannschaft[$x]->tln_nr) {
     $zzc++;
     if (!isset($count[$zl]->rrang)) {
         $pdf->Cell(10, $zelle, $zn, 0, 0, 'C');
     } else {
         $pdf->Cell(10, $zelle, $count[$zl]->rrang, 0, 0, 'C');
     }
     if ($pdf->GetStringWidth(utf8_decode($count[$zl]->name)) > $breite1) {
         $htext = utf8_decode($count[$zl]->name);
         while ($pdf->GetStringWidth($htext) > $breite1) {
             $htext = substr($htext, 0, -1);
         }
         $pdf->Cell($breite1, $zelle, $htext, 0, 0, 'L');
     } else {
         $pdf->Cell($breite1, $zelle, utf8_decode($count[$zl]->name), 0, 0, 'L');
     }
     $pdf->Cell(10, $zelle, $count[$zl]->dwz, 0, 0, 'R');
 } else {
     $pdf->Cell(50, $zelle, '', 0, 0, 'C');
     $zl--;
 }
 $pdf->Cell(10, $zelle, '', 0, 0, 'R');
 $yn++;
开发者ID:ChessLeagueManager,项目名称:deprecated,代码行数:31,代码来源:start_pdf.php


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