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


PHP TTi18n::getPDFDefaultFont方法代码示例

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


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

示例1: __construct

 function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $encoding = 'UTF-8', $diskcache = FALSE)
 {
     if (TTi18n::getPDFDefaultFont() != 'freeserif' and $encoding == 'ISO-8859-1') {
         parent::__construct($orientation, $unit, $format, FALSE, 'ISO-8859-1', $diskcache);
         //Make sure TCPDF constructor is called with all the arguments
     } else {
         parent::__construct($orientation, $unit, $format, TRUE, $encoding, $diskcache);
         //Make sure TCPDF constructor is called with all the arguments
     }
     Debug::Text('PDF Encoding: ' . $encoding, __FILE__, __LINE__, __METHOD__, 10);
     /*
     if ( TTi18n::getPDFDefaultFont() == 'freeserif' ) {
     	Debug::Text('Using unicode PDF: Font: freeserif Unicode: '. (int)$unicode .' Encoding: '. $encoding, __FILE__, __LINE__, __METHOD__,10);
     } else {
     	//If we're only using English, default to faster non-unicode settings.
     	//unicode=FALSE and encoding='ISO-8859-1' is about 20-30% faster.
     	Debug::Text('Using non-unicode PDF: Font: helvetica Unicode: '. (int)$unicode .' Encoding: '. $encoding, __FILE__, __LINE__, __METHOD__,10);
     	parent::__construct($orientation, $unit, $format, FALSE, 'ISO-8859-1', $diskcache); //Make sure TCPDF constructor is called with all the arguments
     }
     */
     //Using freeserif font enabling font subsetting is slow and produces PDFs at least 1mb. Helvetica is fine though.
     $this->setFontSubsetting(TRUE);
     //When enabled, makes PDFs smaller, but severly slows down TCPDF if enabled. (+6 seconds per PDF)
     $this->SetCreator(APPLICATION_NAME . ' ' . getTTProductEditionName() . ' v' . APPLICATION_VERSION);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:26,代码来源:TTPDF.class.php

示例2: getFormObject

 function getFormObject($form)
 {
     $class_name = 'ChequeForms';
     $class_name .= '_' . $form;
     $class_directory = dirname(__FILE__);
     $class_file_name = $class_directory . DIRECTORY_SEPARATOR . strtolower($form) . '.class.php';
     Debug::text('Class Directory: ' . $class_directory, __FILE__, __LINE__, __METHOD__, 10);
     Debug::text('Class File Name: ' . $class_file_name, __FILE__, __LINE__, __METHOD__, 10);
     Debug::text('Class Name: ' . $class_name, __FILE__, __LINE__, __METHOD__, 10);
     if (file_exists($class_file_name)) {
         include_once $class_file_name;
         $obj = new $class_name();
         $obj->setClassDirectory($class_directory);
         $obj->default_font = TTi18n::getPDFDefaultFont();
         return $obj;
     } else {
         Debug::text('Class File does not exist!', __FILE__, __LINE__, __METHOD__, 10);
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:20,代码来源:ChequeForms.class.php

示例3: getPayStub

 function getPayStub($pslf = NULL, $hide_employer_rows = TRUE)
 {
     if (!is_object($pslf) and $this->getId() != '') {
         $pslf = TTnew('PayStubListFactory');
         $pslf->getById($this->getId());
     }
     if (get_class($pslf) !== 'PayStubListFactory') {
         return FALSE;
     }
     $border = 0;
     if ($pslf->getRecordCount() > 0) {
         $pdf = new TTPDF('P', 'mm', 'Letter');
         $pdf->setMargins(0, 0);
         //$pdf->SetAutoPageBreak(TRUE, 30);
         $pdf->SetAutoPageBreak(FALSE);
         $i = 0;
         foreach ($pslf as $pay_stub_obj) {
             $psealf = TTnew('PayStubEntryAccountListFactory');
             //Debug::text($i .'. Pay Stub Transaction Date: '. $pay_stub_obj->getTransactionDate(), __FILE__, __LINE__, __METHOD__,10);
             //Get Pay Period information
             $pplf = TTnew('PayPeriodListFactory');
             $pay_period_obj = $pplf->getById($pay_stub_obj->getPayPeriod())->getCurrent();
             //Use Pay Stub dates, not Pay Period dates.
             $pp_start_date = $pay_stub_obj->getStartDate();
             $pp_end_date = $pay_stub_obj->getEndDate();
             $pp_transaction_date = $pay_stub_obj->getTransactionDate();
             //Get User information
             $ulf = TTnew('UserListFactory');
             $user_obj = $ulf->getById($pay_stub_obj->getUser())->getCurrent();
             //Get company information
             $clf = TTnew('CompanyListFactory');
             $company_obj = $clf->getById($user_obj->getCompany())->getCurrent();
             //Change locale to users own locale.
             TTi18n::setLanguage($user_obj->getUserPreferenceObject()->getLanguage());
             TTi18n::setCountry($user_obj->getCountry());
             TTi18n::setLocale();
             $pdf->SetFont(TTi18n::getPDFDefaultFont($user_obj->getUserPreferenceObject()->getLanguage()), '', 10);
             //
             // Pay Stub Header
             //
             $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
             $pdf->AddPage();
             $adjust_x = 20;
             $adjust_y = 10;
             //Logo
             $pdf->Image($company_obj->getLogoFileName(NULL, TRUE, FALSE, 'large'), Misc::AdjustXY(0, $adjust_x + 0), Misc::AdjustXY(1, $adjust_y + 0), $pdf->pixelsToUnits(167), $pdf->pixelsToUnits(42), '', '', '', FALSE, 300, '', FALSE, FALSE, 0, TRUE);
             //Company name/address
             $pdf->SetFont('', 'B', 14);
             $pdf->setXY(Misc::AdjustXY(50, $adjust_x), Misc::AdjustXY(0, $adjust_y));
             $pdf->Cell(75, 5, $company_obj->getName(), $border, 0, 'C', FALSE, '', 1);
             $pdf->SetFont('', '', 10);
             $pdf->setXY(Misc::AdjustXY(50, $adjust_x), Misc::AdjustXY(6, $adjust_y));
             $pdf->Cell(75, 5, $company_obj->getAddress1() . ' ' . $company_obj->getAddress2(), $border, 0, 'C', FALSE, '', 1);
             $pdf->setXY(Misc::AdjustXY(50, $adjust_x), Misc::AdjustXY(10, $adjust_y));
             $pdf->Cell(75, 5, $company_obj->getCity() . ', ' . $company_obj->getProvince() . ' ' . strtoupper($company_obj->getPostalCode()), $border, 0, 'C', FALSE, '', 1);
             //Pay Period info
             $pdf->SetFont('', '', 10);
             $pdf->setXY(Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY(0, $adjust_y));
             $pdf->Cell(30, 5, TTi18n::gettext('Pay Start Date:') . ' ', $border, 0, 'R', FALSE, '', 1);
             $pdf->setXY(Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY(5, $adjust_y));
             $pdf->Cell(30, 5, TTi18n::gettext('Pay End Date:') . ' ', $border, 0, 'R', FALSE, '', 1);
             $pdf->setXY(Misc::AdjustXY(125, $adjust_x), Misc::AdjustXY(10, $adjust_y));
             $pdf->Cell(30, 5, TTi18n::gettext('Payment Date:') . ' ', $border, 0, 'R', FALSE, '', 1);
             $pdf->SetFont('', 'B', 10);
             $pdf->setXY(Misc::AdjustXY(155, $adjust_x), Misc::AdjustXY(0, $adjust_y));
             $pdf->Cell(20, 5, TTDate::getDate('DATE', $pp_start_date), $border, 0, 'R', FALSE, '', 1);
             $pdf->setXY(Misc::AdjustXY(155, $adjust_x), Misc::AdjustXY(5, $adjust_y));
             $pdf->Cell(20, 5, TTDate::getDate('DATE', $pp_end_date), $border, 0, 'R', FALSE, '', 1);
             $pdf->setXY(Misc::AdjustXY(155, $adjust_x), Misc::AdjustXY(10, $adjust_y));
             $pdf->Cell(20, 5, TTDate::getDate('DATE', $pp_transaction_date), $border, 0, 'R', FALSE, '', 1);
             //Line
             $pdf->setLineWidth(1);
             $pdf->Line(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY(17, $adjust_y), Misc::AdjustXY(185, $adjust_y), Misc::AdjustXY(17, $adjust_y));
             $pdf->SetFont('', 'B', 14);
             $pdf->setXY(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY(19, $adjust_y));
             $pdf->Cell(175, 5, TTi18n::gettext('STATEMENT OF EARNINGS AND DEDUCTIONS'), $border, 0, 'C', FALSE, '', 1);
             //Line
             $pdf->setLineWidth(1);
             $pdf->Line(Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY(27, $adjust_y), Misc::AdjustXY(185, $adjust_y), Misc::AdjustXY(27, $adjust_y));
             $pdf->setLineWidth(0.25);
             //Get pay stub entries.
             $pself = TTnew('PayStubEntryListFactory');
             $pself->getByPayStubId($pay_stub_obj->getId());
             Debug::text('Pay Stub Entries: ' . $pself->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10);
             $max_widths = array('units' => 0, 'rate' => 0, 'amount' => 0, 'ytd_amount' => 0);
             $prev_type = NULL;
             $description_subscript_counter = 1;
             foreach ($pself as $pay_stub_entry) {
                 //Debug::text('Pay Stub Entry Account ID: '.$pay_stub_entry->getPayStubEntryNameId()  , __FILE__, __LINE__, __METHOD__,10);
                 $description_subscript = NULL;
                 $pay_stub_entry_name_obj = $psealf->getById($pay_stub_entry->getPayStubEntryNameId())->getCurrent();
                 //Use this to put the total for each type at the end of the array.
                 if ($prev_type == 40 or $pay_stub_entry_name_obj->getType() != 40) {
                     $type = $pay_stub_entry_name_obj->getType();
                 }
                 //Debug::text('Pay Stub Entry Name ID: '. $pay_stub_entry_name_obj->getId() .' Type ID: '. $pay_stub_entry_name_obj->getType() .' Type: '. $type, __FILE__, __LINE__, __METHOD__,10);
                 if ($pay_stub_entry->getDescription() !== NULL and $pay_stub_entry->getDescription() !== FALSE and strlen($pay_stub_entry->getDescription()) > 0 and ($type != 30 or $type == 30 and $hide_employer_rows == FALSE)) {
                     //Make sure PSA descriptions are not shown on employee pay stubs.
                     $pay_stub_entry_descriptions[] = array('subscript' => $description_subscript_counter, 'description' => $pay_stub_entry->getDescription());
                     $description_subscript = $description_subscript_counter;
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:PayStubFactory.class.php

示例4: setOtherConfig

 function setOtherConfig($data)
 {
     if (is_array($data)) {
         if (!isset($data['default_font']) or isset($data['default_font']) and $data['default_font'] == '') {
             $data['default_font'] = TTi18n::getPDFDefaultFont();
         }
         if (isset($data['maximum_page_limit']) and (int) $data['maximum_page_limit'] != 0) {
             if ($data['maximum_page_limit'] > 10000) {
                 $data['maximum_page_limit'] = 10000;
             } elseif ($data['maximum_page_limit'] < 2) {
                 $data['maximum_page_limit'] = 2;
             }
         } else {
             unset($data['maximum_page_limit']);
             //Use default.
         }
         $this->config['other'] = array_merge($this->config['other'], $data);
         //Merge data as to keep default settings whenever possible.
         return TRUE;
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:22,代码来源:Report.class.php

示例5: TimeSheet

         exit;
     } else {
         //Debug::Display();
         echo TTi18n::gettext('ERROR: Employee TimeSheet(s) not available!') . "<br>\n";
         Debug::writeToLog();
         exit;
     }
 } elseif ($action == 'display_detailed_timesheet') {
     $output = FALSE;
     if (isset($rows)) {
         $pdf_created_date = time();
         //Page width: 205mm
         $pdf = new TTPDF('P', 'mm', 'Letter');
         $pdf->setMargins(10, 5);
         $pdf->SetAutoPageBreak(TRUE, 10);
         $pdf->SetFont(TTi18n::getPDFDefaultFont(), '', 10);
         $border = 0;
         //Create PDF TimeSheet for each employee.
         foreach ($rows as $user_data) {
             $pdf->AddPage();
             $adjust_x = 10;
             $adjust_y = 10;
             //$pdf->setXY( Misc::AdjustXY(0, $adjust_x), Misc::AdjustXY(0, $adjust_y) );
             $pdf->SetFont('', 'B', 22);
             $pdf->Cell(200, 8, TTi18n::gettext('Detailed Employee TimeSheet'), $border, 0, 'C');
             $pdf->Ln();
             $pdf->SetFont('', 'B', 12);
             $pdf->Cell(200, 5, $current_company->getName(), $border, 0, 'C');
             $pdf->Ln(8);
             $pdf->Rect($pdf->getX(), $pdf->getY() - 1, 200, 14);
             $pdf->SetFont('', '', 10);
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:TimesheetDetail.php


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