示例#1
0
文件: chinese.php 项目: hugcoday/wiki
 function GetStringWidth($s)
 {
     if ($this->CurrentFont['type'] == 'Type0') {
         return $this->GetMBStringWidth($s);
     } else {
         return parent::GetStringWidth($s);
     }
 }
 /**
  *   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);
 }
示例#3
0
 /**
  * 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);
 }
     $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;
示例#5
0
文件: ex.php 项目: rohmad-st/fpdf
<?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();
示例#6
0
 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) {
             $pdf->MultiRow(50, Locale::translate("proposal.articleSecId"), $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L');
             $firstSecId = true;
         } else {
             $pdf->MultiRow(50, '', $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.protocolVersion"), $details->getProtocolVersion(), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.therapeuticArea"), $details->getRightTherapeuticAreaDisplay(), 'L');
     $pdf->Ln(3);
     $firstICD10 = null;
     foreach ($details->getHealthCondDiseaseArrayToDisplay() as $healthCond) {
         $code = $healthCond['code'];
         $exactCode = $healthCond['exactCode'];
         if ($exactCode != '') {
             $code = $code . ' (' . $exactCode . ')';
         }
         if (!$firstICD10) {
             $pdf->MultiRow(50, Locale::translate("proposal.icd10s"), $code, 'L');
             $firstICD10 = true;
         } else {
             $pdf->MultiRow(50, '', $code, 'L');
         }
     }
     $pdf->Ln(3);
     $firstPurpose = null;
     foreach ($purposes as $purpose) {
         if (!$firstPurpose) {
             $purposeTitle = Locale::translate("proposal.purposes");
             $firstPurpose = true;
         } else {
             $purposeTitle = '';
         }
         if ($purpose->getType() == ARTICLE_PURPOSE_TYPE_OBS) {
             $pdf->MultiRow(50, $purposeTitle, Locale::translate($purpose->getTypeKey()), 'L');
         } else {
             $pdf->MultiRow(50, $purposeTitle, Locale::translate('proposal.purpose.type.int'), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.purposes.type') . ':    ' . Locale::translate($purpose->getTypeKey()), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.purposes.ctPhase') . ':    ' . Locale::translate($purpose->getCTPhaseKey()), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.purposes.studyDesign') . ', ' . Locale::translate('proposal.purposes.allocation') . ':    ' . Locale::translate($purpose->getAllocationKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.masking') . ':    ' . Locale::translate($purpose->getMaskingKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.control') . ':    ' . Locale::translate($purpose->getControlKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.assignment') . ':    ' . Locale::translate($purpose->getAssignmentKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.endpoint') . ':    ' . Locale::translate($purpose->getEndpointKey()), 'L');
         }
     }
     $pdf->Ln(3);
     $description = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$description) {
             $pdf->MultiRow(50, Locale::translate("proposal.description"), $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $description = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $kic = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$kic) {
             $pdf->MultiRow(50, Locale::translate("proposal.keyInclusionCriteria"), $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $kic = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $kec = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$kec) {
             $pdf->MultiRow(50, Locale::translate("proposal.keyExclusionCriteria"), $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $kec = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $firstPOutcome = null;
     foreach ($articlePrimaryOutcomes as $articleOutcomeLocales) {
         foreach ($articleOutcomeLocales as $key => $articleOutcome) {
             if (!$firstPOutcome) {
                 $outcomeTitle = Locale::translate("proposal.primaryOutcomes");
                 $firstPOutcome = true;
             } else {
                 $outcomeTitle = '';
             }
             $pdf->MultiRow(50, $outcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.measurement') . ':        ' . $articleOutcome->getMeasurement(), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.timepoint') . ':        ' . $articleOutcome->getTimepoint(), 'L');
             $pdf->Ln(3);
         }
     }
     $firstSOutcome = null;
     foreach ($articleSecondaryOutcomes as $articleOutcomeLocales) {
         foreach ($articleOutcomeLocales as $key => $articleOutcome) {
             if (!$firstSOutcome) {
                 $sOutcomeTitle = Locale::translate("proposal.secondaryOutcomes");
                 $firstSOutcome = true;
             } else {
                 $sOutcomeTitle = '';
             }
             $pdf->MultiRow(50, $sOutcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.measurement') . ':        ' . $articleOutcome->getMeasurement(), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.timepoint') . ':        ' . $articleOutcome->getTimepoint(), 'L');
             $pdf->Ln(3);
         }
     }
     $pdf->MultiRow(50, Locale::translate("proposal.age.minimum"), $details->getMinAgeNum() . ' ' . Locale::translate($details->getMinAgeUnitKey()), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.age.maximum"), $details->getMaxAgeNum() . ' ' . Locale::translate($details->getMaxAgeUnitKey()), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.sex"), Locale::translate($details->getSexKey()), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.healthy"), Locale::translate($details->getYesNoKey($details->getHealthy())), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.localeSampleSize"), $details->getLocaleSampleSize(), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.multinational") . ' ' . $journal->getLocalizedSetting('location'), Locale::translate($details->getYesNoKey($details->getMultinational())), 'L');
     if ($details->getMultinational() == ARTICLE_DETAIL_YES) {
         foreach ($details->getIntSampleSizeArray() as $countryAndNumberArray) {
             $country = $countryAndNumberArray['country'];
             $pdf->MultiRow(50, '', '        ' . $coutryList[$country] . ': ' . $countryAndNumberArray['number'], 'L');
         }
     }
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.expectedDate"), Locale::translate('proposal.startDate') . ': ' . $details->getStartDate() . ', ' . Locale::translate('proposal.endDate') . ': ' . $details->getEndDate(), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.recruitment"), Locale::translate("proposal.recruitment.status") . ': ' . Locale::translate($details->getRecruitmentStatusKey()), 'L');
     $rssi = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if ($articleText->getRecruitmentInfo() != '') {
             if (!$rssi) {
                 $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.info") . ': ' . $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
                 $rssi = true;
             } else {
                 $pdf->MultiRow(50, '', $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             }
         }
     }
     $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.adScheme") . ': ' . Locale::translate($details->getYesNoKey($details->getAdvertisingScheme())), 'L');
     // Line break
     $pdf->Ln(10);
     //Drug products
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'II' . Locale::translate('common.queue.long.articleDrugs', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     foreach ($articleDrugs as $articleDrug) {
         $pdf->SetFont('Times', 'BU', 12);
         $pdf->Cell(190, 9, $articleDrug->getName(), 0, 1, 'L');
         $pdf->SetFont('Times', '', 12);
         $pdf->Ln(3);
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.type"), Locale::translate($articleDrug->getTypeKey()), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.name"), $articleDrug->getName(), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.brandName"), $articleDrug->getBrandName(), 'L');
         if ($articleDrug->getOtherAdministration() == 'NA') {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), Locale::translate($articleDrug->getAdministrationKey()), 'L');
         } else {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), $articleDrug->getOtherAdministration(), 'L');
         }
         if ($articleDrug->getOtherForm() == 'NA') {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), Locale::translate($articleDrug->getFormKey()), 'L');
         } else {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), $articleDrug->getOtherForm(), 'L');
         }
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.strength"), $articleDrug->getStrength(), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.storage"), Locale::translate($articleDrug->getStorageKey()), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.pharmaClass"), $pharmaClasses[$articleDrug->getPharmaClass()], 'L');
         $firstClass = false;
         $classIIIOrIV = false;
         $classesToDisplay = '';
         foreach ($articleDrug->getClassesArray() as $class) {
             if ($class == ARTICLE_DRUG_INFO_CLASS_III || $class == ARTICLE_DRUG_INFO_CLASS_IV) {
                 $classIIIOrIV = true;
             }
             if (!$firstClass) {
                 $classesToDisplay = Locale::translate($drugStudyClasses[$class]);
             } else {
                 $classesToDisplay = $classesToDisplay . ', ' . Locale::translate($drugStudyClasses[$class]);
             }
             $firstClass = true;
         }
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.studyClasses"), $classesToDisplay, 'L');
         if ($classIIIOrIV) {
             $countriesToDisplay = '';
             $firstCountry = false;
             foreach ($articleDrug->getCountriesArray() as $country) {
                 if (!$firstCountry) {
                     $countriesToDisplay = $coutryList[$country];
                 } else {
                     $countriesToDisplay = $countriesToDisplay . ', ' . $coutryList[$country];
                 }
                 $firstCountry = true;
             }
             $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.countries") . ': ' . $countriesToDisplay, 'L');
             $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.conditionsOfUse") . ': ' . Locale::translate($articleDrug->getDifferentConditionsOfUseKey()), 'L');
         }
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.cpr"), Locale::translate($articleDrug->getCPRKey()), 'L');
         if ($articleDrug->getCPR() == ARTICLE_DRUG_INFO_YES) {
             $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.drugRegistrationNumber") . ': ' . $articleDrug->getDrugRegistrationNumber(), 'L');
         }
         if ($articleDrug->getImportedQuantity() != '') {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.importedQuantity"), $articleDrug->getImportedQuantity(), 'L');
         }
         $firstManufacturer = false;
         foreach ($articleDrug->getManufacturers() as $manufacturer) {
             $manufacturerTitle = '';
             if (!$firstManufacturer) {
                 $manufacturerTitle = Locale::translate('proposal.drugInfo.manufacturers');
             }
             $pdf->MultiRow(50, $manufacturerTitle, $manufacturer->getName(), 'L');
             $pdf->MultiRow(50, '', Locale::translate('proposal.drugInfo.manufacturer.address') . ': ' . $manufacturer->getAddress(), 'L');
             $firstManufacturer = true;
             $pdf->Ln(2);
         }
         $pdf->Ln(3);
     }
     // Line break
     $pdf->Ln(10);
     // Trial Site(s)
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'III' . Locale::translate('common.queue.long.articleSites', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     foreach ($articleSites as $articleSite) {
         $trialSiteObject = $articleSite->getTrialSiteObject();
         $pdf->SetFont('Times', 'BU', 12);
         $pdf->Cell(190, 9, $trialSiteObject->getName(), 0, 1, 'L');
         $pdf->SetFont('Times', '', 12);
         $pdf->Ln(3);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.site"), $trialSiteObject->getName(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAddress') . ': ' . $trialSiteObject->getAddress(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteCity') . ': ' . $trialSiteObject->getCity(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteRegion') . ': ' . $trialSiteObject->getRegionText(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteLicensure') . ': ' . $trialSiteObject->getLicensure(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAccreditation') . ': ' . $trialSiteObject->getAccreditation(), 'L');
         $pdf->Ln(2);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.erc"), $articleSite->getERCName(), 'L');
         $pdf->Ln(2);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.authority"), $articleSite->getAuthority(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.primaryPhone') . ': ' . $articleSite->getPrimaryPhone(), 'L');
         if ($articleSite->getSecondaryPhone()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.secondaryPhone') . ': ' . $articleSite->getSecondaryPhone(), 'L');
         }
         if ($articleSite->getFax()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.fax') . ': ' . $articleSite->getFax(), 'L');
         }
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.email') . ': ' . $articleSite->getEmail(), 'L');
         $pdf->Ln(2);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.subjectsNumber"), $articleSite->getSubjectsNumber(), 'L');
         $pdf->Ln(2);
         $countInvestigators = 1;
         foreach ($articleSite->getInvestigators() as $investigator) {
             $investigatorTitle = "";
             if ($countInvestigators == 1) {
                 $investigatorTitle = Locale::translate('user.role.primaryInvestigator');
             } elseif ($countInvestigators == 2) {
                 $investigatorTitle = Locale::translate('user.role.coinvestigator');
             }
             $pdf->MultiRow(50, $investigatorTitle, $investigator->getFullName(), 'L');
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.expertise') . ': ' . $expertisesList[$investigator->getExpertise()], 'L');
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iPrimaryPhone') . ': ' . $investigator->getPrimaryPhoneNumber(), 'L');
             if ($investigator->getSecondaryPhoneNumber()) {
                 $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iSecondaryPhone') . ': ' . $investigator->getSecondaryPhoneNumber(), 'L');
             }
             if ($investigator->getFaxNumber()) {
                 $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iFax') . ': ' . $investigator->getFaxNumber(), 'L');
             }
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iEmail') . ': ' . $investigator->getEmail(), 'L');
             $countInvestigators++;
         }
         $pdf->Ln(3);
     }
     // Line break
     $pdf->Ln(10);
     // Sponsors
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'IV' . Locale::translate('common.queue.long.articleSponsors', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     $pdf->SetFont('Times', '', 12);
     $firstFSource = false;
     foreach ($fundingSources as $fundingSource) {
         $fSourceTitle = '';
         if (!$firstFSource) {
             $fSourceTitle = Locale::translate('proposal.articleSponsor.fundingSources');
         }
         $institution = $fundingSource->getInstitutionObject();
         $pdf->MultiRow(50, $fSourceTitle, $institution->getInstitutionName(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L');
         if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L');
         } else {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L');
         }
         $pdf->Ln(2);
         $firstFSource = true;
     }
     $pdf->Ln(1);
     $institution = $pSponsor->getInstitutionObject();
     $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.primarySponsor"), $institution->getInstitutionName(), 'L');
     $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L');
     $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L');
     $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L');
     if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) {
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L');
     } else {
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L');
     }
     $pdf->Ln(3);
     $firstSSponsor = false;
     foreach ($sSponsors as $sSponsor) {
         $SSponsorTitle = '';
         if (!$firstSSponsor) {
             $SSponsorTitle = Locale::translate('proposal.articleSponsor.secondarySponsors');
         }
         $institution = $sSponsor->getInstitutionObject();
         $pdf->MultiRow(50, $SSponsorTitle, $institution->getInstitutionName(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L');
         if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L');
         } else {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L');
         }
         $pdf->Ln(2);
         $firstSSponsor = true;
     }
     $pdf->Ln(1);
     $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.croInvolved"), Locale::translate($details->getYesNoKey($details->getCROInvolved())), 'L');
     foreach ($CROs as $CRO) {
         $pdf->MultiRow(50, '', $CRO->getName(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.location') . ': ' . $CRO->getInternationalText(), 'L');
         if ($CRO->getInternational() == CRO_INTERNATIONAL) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $CRO->getLocationText(), 'L');
         } else {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $CRO->getLocationText(), 'L');
         }
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.city') . ': ' . $CRO->getCity(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.address') . ': ' . $CRO->getAddress(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.primaryPhone') . ': ' . $CRO->getPrimaryPhone(), 'L');
         if ($CRO->getSecondaryPhone()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.secondaryPhone') . ': ' . $CRO->getSecondaryPhone(), 'L');
         }
         if ($CRO->getFax()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.fax') . ': ' . $CRO->getFax(), 'L');
         }
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.email') . ': ' . $CRO->getEmail(), 'L');
         $pdf->Ln(2);
     }
     $pdf->Ln(1);
     // Line break
     $pdf->Ln(10);
     // Contact Information
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'V' . Locale::translate('common.queue.long.articleContact', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     $pdf->SetFont('Times', '', 12);
     $pdf->MultiRow(50, Locale::translate("proposal.articleContact.pq"), $contact->getPQName(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getPQAffiliation(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getPQAddress(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getPQCountry()], 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getPQPhone(), 'L');
     if ($contact->getPQFax() != '') {
         $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getPQFax(), 'L');
     }
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getPQEmail(), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.articleContact.sq"), $contact->getSQName(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getSQAffiliation(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getSQAddress(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getSQCountry()], 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getSQPhone(), 'L');
     if ($contact->getPQFax() != '') {
         $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getSQFax(), 'L');
     }
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getSQEmail(), 'L');
     $pdf->Output($submission->getProposalId() . '-' . Locale::translate('submission.summary') . '.pdf', "D");
 }
     $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;
 }
示例#8
0
 /**
  * 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);
 }
 $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;
示例#10
0
$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);
示例#11
0
 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');
示例#12
0
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");
示例#13
0
     $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);
     $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 = "-";
示例#15
0
 $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++;
$pdf->SetMargins(15, 10, 10);
//Ränder links ,rechts, oben
//Calc size of each field based on its title, then total width ex. products description field,
//and asssign max. possible value to products description field
$pdf->font = 'Arial';
$pdf->SetFont($pdf->font, BOLD, 10);
$total = 0;
for ($i = 0; $i < sizeof($x_text); $i++) {
    $text = $x_text[$i];
    $text_parts = split(NEW_LINE, $text);
    $text_parts_count = sizeof($text_parts);
    if ($text_parts_count > 1) {
        $text_len = 0;
        for ($j = 0; $j < $text_parts_count; $j++) {
            $text_1 = $text_parts[$j];
            if ($pdf->GetStringWidth($text_1) > $text_len) {
                $text = $text_1;
            }
        }
    }
    $text = BLANK . $text . BLANK;
    $w = ceil($pdf->GetStringWidth($text));
    if ($w > $x_width[$i]) {
        $x_width[$i] = $w;
    }
    if ($i != $products_field_item) {
        $total += $x_width[$i];
    }
}
$products_field_width = $pdf->w - $pdf->lMargin - $pdf->rMargin - $total - $tax_field_width;
$x_width[$products_field_item] = $products_field_width;
 /**
  *   Show table for lines
  *
  *   @param		PDF			$pdf     		Object PDF
  *   @param		string		$tab_top		Top position of table
  *   @param		string		$tab_height		Height of table (rectangle)
  *   @param		int			$nexY			Y (not used)
  *   @param		Translate	$outputlangs	Langs object
  *   @param		int			$hidetop		1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
  *   @param		int			$hidebottom		Hide bottom bar of array
  *   @param		string		$currency		Currency code
  *   @return	void
  */
 function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
 {
     global $conf;
     // Force to disable hidetop and hidebottom
     $hidebottom = 0;
     if ($hidetop) {
         $hidetop = -1;
     }
     $currency = !empty($currency) ? $currency : $conf->currency;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     // Amount in (at tab_top - 1)
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('', '', $default_font_size - 2);
     if (empty($hidetop)) {
         $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency" . $currency));
         $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
         $pdf->MultiCell($pdf->GetStringWidth($titre) + 3, 2, $titre);
         //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
         if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
             $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
         }
     }
     $pdf->SetDrawColor(128, 128, 128);
     $pdf->SetFont('', '', $default_font_size - 1);
     // Output Rect
     $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
     // Rect prend une longueur en 3eme param et 4eme param
     if (empty($hidetop)) {
         $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
         // line prend une position y en 2eme param et 4eme param
         $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
         $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L');
     }
     if (!empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE)) {
         $pdf->line($this->posxpicture - 1, $tab_top, $this->posxpicture - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             //$pdf->SetXY($this->posxpicture-1, $tab_top+1);
             //$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C');
         }
     }
     if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
         $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             $pdf->SetXY($this->posxtva - 3, $tab_top + 1);
             $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities("VAT"), '', 'C');
         }
     }
     $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         $pdf->SetXY($this->posxup - 1, $tab_top + 1);
         $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C');
     }
     $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
         if ($conf->global->PRODUCT_USE_UNITS) {
             $pdf->MultiCell($this->posxunit - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
         } else {
             $pdf->MultiCell($this->posxdiscount - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
         }
     }
     if ($conf->global->PRODUCT_USE_UNITS) {
         $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
             $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
         }
     }
     $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         if ($this->atleastonediscount) {
             $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
             $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
         }
     }
     if ($this->atleastonediscount) {
         $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
     }
     if (empty($hidetop)) {
         $pdf->SetXY($this->postotalht - 1, $tab_top + 1);
         $pdf->MultiCell(30, 2, $outputlangs->transnoentities("TotalHT"), '', 'C');
     }
 }