• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pdf类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: generar

 /**
  * 
  * @param int $id_emergencia
  */
 public function generar($id_emergencia, $mapa = true, $codigo)
 {
     $emergencia = $this->_ci->emergencia_model->getById($id_emergencia);
     if (!is_null($emergencia)) {
         $data = array("eme_ia_id" => $emergencia->eme_ia_id, "eme_c_nombre_emergencia" => $emergencia->eme_c_nombre_emergencia, "eme_c_nombre_informante" => $emergencia->eme_c_nombre_informante, "eme_d_fecha_emergencia" => ISODateTospanish($emergencia->eme_d_fecha_emergencia, false), "hora_emergencia" => ISOTimeTospanish($emergencia->eme_d_fecha_emergencia), "hora_recepcion" => ISOTimeTospanish($emergencia->eme_d_fecha_recepcion), "eme_c_lugar_emergencia" => $emergencia->eme_c_lugar_emergencia, "emisor" => $this->_ci->session->userdata('session_nombres'), "id_usuario_encargado" => $emergencia->usu_ia_id, "eme_c_descripcion" => $emergencia->eme_c_descripcion, "est_ia_id" => $emergencia->est_ia_id, "tip_ia_id" => $emergencia->tip_ia_id);
         $datos = unserialize($emergencia->eme_c_datos_tipo_emergencia);
         foreach ($datos as $key => $value) {
             $data['form_tipo_' . $key] = $value;
         }
     }
     $data['codigo'] = $codigo;
     $data['region'] = '';
     $regiones = explode(',', $this->_ci->session->userdata('session_regiones'));
     if (count($regiones) == 1) {
         if ($regiones[0] == 13) {
             $data['region'] = 'RM';
         } else {
             $data['region'] = $regiones[0] . 'º';
         }
     }
     $data['cargo'] = $this->_ci->session->userdata('session_cargo');
     $data['mapa'] = $mapa;
     $html = $this->_ci->load->view('pages/emergencia_reporte/pdf', $data, true);
     $this->_pdf->imagen_mapa = $this->_imagen;
     $this->_pdf->imagen_logo = file_get_contents(FCPATH . "/assets/img/top_logo.png");
     $this->_pdf->SetFooter($_SERVER['HTTP_HOST'] . '|{PAGENO}/{nb}|' . date('d-m-Y H:i'));
     $this->_pdf->WriteHTML($html);
     return $this->_pdf->Output('acta.pdf', 'S');
 }
开发者ID:CarlosAyala,项目名称:midas-codeigniter-modulo-emergencias,代码行数:33,代码来源:Emergencia_pdf.php


示例2: movie_get_file_metadata

 /**
  * Get PDF file metadata (height and width)
  * (ref: movie::get_file_metadata())
  */
 static function movie_get_file_metadata($file_path, $metadata)
 {
     if (strtolower(pathinfo($file_path, PATHINFO_EXTENSION)) == "pdf" && ($path = pdf::find_gs())) {
         // Parsing gs output properly can be a pain.  So, let's go for a reliable albeit inefficient
         // approach: re-extract the frame (into tmp) and get its image size.
         $temp_file = system::temp_filename("pdf_", "jpg");
         pdf_event::movie_extract_frame($file_path, $temp_file, null, null);
         list($metadata->height, $metadata->width) = photo::get_file_metadata($temp_file);
     }
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:14,代码来源:pdf_event.php


示例3: get_gs_version

 /**
  * Return version number of gs if found, an empty string if not.
  * (ref: movie::get_ffmpeg_version())
  */
 static function get_gs_version()
 {
     if (pdf::find_gs()) {
         $path = module::get_var("pdf", "gs_path");
         exec(escapeshellcmd($path) . " -version", $output);
         if (stristr($output[0], "ghostscript")) {
             // Found "ghostscript" in the response - it's valid.
             return $output[0];
         }
     }
     return "";
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:16,代码来源:pdf.php


示例4: _print_screen

 private function _print_screen($form)
 {
     // get module parameters
     $gs_path = pdf::find_gs();
     $gs_dir = substr($gs_path, 0, strrpos($gs_path, "/"));
     $gs_version = pdf::get_gs_version();
     // make and print view
     $view = new Admin_View("admin.html");
     $view->page_title = t("PDF settings");
     $view->content = new View("admin_pdf.html");
     $view->content->form = $form;
     $view->content->gs_dir = $gs_dir;
     $view->content->gs_version = $gs_version;
     print $view;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:15,代码来源:admin_pdf.php


示例5: certificate_output_completion

/**
 * Outputs a certificate for some sort of completion element
 *
 * @param  string  $person_fullname  The full name of the certificate recipient
 * @param  string  $entity_name      The name of the entity that is compelted
 * @param  string  $certificatecode  The unique certificate code
 * @param  string  $date_string      Date /time the certification was achieved
 * @param  string  $curriculum_frequency the curriculum frequency
 * @param  string  $expirydate       A string representing the time that the
 * certificate expires (optional).
 */
function certificate_output_completion($person_fullname, $entity_name, $certificatecode = '', $date_string, $expirydate = '', $curriculum_frequency = '', $border = '', $seal = '', $template = '')
{
    global $CFG, $COURSE;
    //use the TCPDF library
    require_once $CFG->libdir . '/pdflib.php';
    //global settings
    $borders = 0;
    $font = 'FreeSerif';
    $large_font_size = 30;
    $small_font_size = 16;
    //create pdf
    $pdf = new pdf('L', 'in', 'Letter');
    //prevent the pdf from printing black bars
    $pdf->print_header = false;
    $pdf->print_footer = false;
    //add main (only) page
    $pdf->AddPage();
    //draw the border
    cm_certificate_check_data_path('borders');
    if (file_exists($CFG->dirroot . '/curriculum/pix/certificate/borders/' . $border)) {
        $pdf->Image($CFG->dirroot . '/curriculum/pix/certificate/borders/' . $border, 0.25, 0.25, 10.5, 8.0);
    } else {
        if (file_exists($CFG->dataroot . '/' . $COURSE->id . '/curriculum/pix/certificate/borders/' . $border)) {
            $pdf->Image($CFG->dataroot . '/' . $COURSE->id . '/curriculum/pix/certificate/borders/' . $border, 0.25, 0.25, 10.5, 8.0);
        }
    }
    //draw the seal
    cm_certificate_check_data_path('seals');
    if (file_exists($CFG->dirroot . '/curriculum/pix/certificate/seals/' . $seal)) {
        $pdf->Image($CFG->dirroot . '/curriculum/pix/certificate/seals/' . $seal, 8.0, 5.8);
    } else {
        if (file_exists($CFG->dataroot . '/' . $COURSE->id . '/curriculum/pix/certificate/seals/' . $seal)) {
            $pdf->Image($CFG->dataroot . '/' . $COURSE->id . '/curriculum/pix/certificate/seals/' . $seal, 8.0, 5.8);
        }
    }
    //include template
    cm_certificate_check_data_path('templates');
    if (file_exists($CFG->dirroot . '/curriculum/pix/certificate/templates/' . $template)) {
        include $CFG->dirroot . '/curriculum/pix/certificate/templates/' . $template;
    } else {
        if (file_exists($CFG->dataroot . '/' . $COURSE->id . '/curriculum/pix/certificate/templates/' . $template)) {
            include $CFG->dirroot . '/curriculum/pix/certificate/templates/' . $template;
        }
    }
    $pdf->Output();
}
开发者ID:remotelearner,项目名称:elis.cm,代码行数:57,代码来源:certificate.php


示例6: actionView

 /**
  * printanswers::view()
  * View answers at the end of a survey in one place. To export as pdf, set 'usepdfexport' = 1 in lsconfig.php and $printableexport='pdf'.
  * @param mixed $surveyid
  * @param bool $printableexport
  * @return
  */
 function actionView($surveyid, $printableexport = FALSE)
 {
     Yii::app()->loadHelper("frontend");
     Yii::import('application.libraries.admin.pdf');
     $iSurveyID = (int) $surveyid;
     $sExportType = $printableexport;
     Yii::app()->loadHelper('database');
     if (isset($_SESSION['survey_' . $iSurveyID]['sid'])) {
         $iSurveyID = $_SESSION['survey_' . $iSurveyID]['sid'];
     } else {
         //die('Invalid survey/session');
     }
     // Get the survey inforamtion
     // Set the language for dispay
     if (isset($_SESSION['survey_' . $iSurveyID]['s_lang'])) {
         $sLanguage = $_SESSION['survey_' . $iSurveyID]['s_lang'];
     } elseif (Survey::model()->findByPk($iSurveyID)) {
         $sLanguage = Survey::model()->findByPk($iSurveyID)->language;
     } else {
         $iSurveyID = 0;
         $sLanguage = Yii::app()->getConfig("defaultlang");
     }
     $clang = SetSurveyLanguage($iSurveyID, $sLanguage);
     $aSurveyInfo = getSurveyInfo($iSurveyID, $sLanguage);
     //SET THE TEMPLATE DIRECTORY
     if (!isset($aSurveyInfo['templatedir']) || !$aSurveyInfo['templatedir']) {
         $aSurveyInfo['templatedir'] = Yii::app()->getConfig('defaulttemplate');
     }
     $sTemplate = validateTemplateDir($aSurveyInfo['templatedir']);
     //Survey is not finished or don't exist
     if (!isset($_SESSION['survey_' . $iSurveyID]['finished']) || !isset($_SESSION['survey_' . $iSurveyID]['srid'])) {
         sendCacheHeaders();
         doHeader();
         echo templatereplace(file_get_contents(getTemplatePath($sTemplate) . '/startpage.pstpl'), array());
         echo "<center><br />\n" . "\t<font color='RED'><strong>" . $clang->gT("Error") . "</strong></font><br />\n" . "\t" . $clang->gT("We are sorry but your session has expired.") . "<br />" . $clang->gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.") . "<br />\n" . "\t" . sprintf($clang->gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail")) . "\n" . "</center><br />\n";
         echo templatereplace(file_get_contents(getTemplatePath($sTemplate) . '/endpage.pstpl'), array());
         doFooter();
         exit;
     }
     //Fin session time out
     $sSRID = $_SESSION['survey_' . $iSurveyID]['srid'];
     //I want to see the answers with this id
     //Ensure script is not run directly, avoid path disclosure
     //if (!isset($rootdir) || isset($_REQUEST['$rootdir'])) {die( "browse - Cannot run this script directly");}
     if ($aSurveyInfo['printanswers'] == 'N') {
         die;
         //Die quietly if print answers is not permitted
     }
     //CHECK IF SURVEY IS ACTIVATED AND EXISTS
     $sSurveyName = $aSurveyInfo['surveyls_title'];
     $sAnonymized = $aSurveyInfo['anonymized'];
     //OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK.
     //SHOW HEADER
     $sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post') . "<center><input type='submit' value='" . $clang->gT("PDF export") . "'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";
     if ($sExportType == 'pdf') {
         //require (Yii::app()->getConfig('rootdir').'/application/config/tcpdf.php');
         Yii::import('application.libraries.admin.pdf', true);
         Yii::import('application.helpers.pdfHelper');
         $aPdfLanguageSettings = pdfHelper::getPdfLanguageSettings($clang->langcode);
         $oPDF = new pdf();
         $oPDF->SetTitle($clang->gT("Survey name (ID)", 'unescaped') . ": {$sSurveyName} ({$iSurveyID})");
         $oPDF->SetSubject($sSurveyName);
         $oPDF->SetDisplayMode('fullpage', 'two');
         $oPDF->setLanguageArray($aPdfLanguageSettings['lg']);
         $oPDF->setHeaderFont(array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_MAIN));
         $oPDF->setFooterFont(array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_DATA));
         $oPDF->SetFont($aPdfLanguageSettings['pdffont'], '', $aPdfLanguageSettings['pdffontsize']);
         $oPDF->AddPage();
         $oPDF->titleintopdf($clang->gT("Survey name (ID)", 'unescaped') . ": {$sSurveyName} ({$iSurveyID})");
     }
     $sOutput .= "\t<div class='printouttitle'><strong>" . $clang->gT("Survey name (ID):") . "</strong> {$sSurveyName} ({$iSurveyID})</div><p>&nbsp;\n";
     LimeExpressionManager::StartProcessingPage(true);
     // means that all variables are on the same page
     // Since all data are loaded, and don't need JavaScript, pretend all from Group 1
     LimeExpressionManager::StartProcessingGroup(1, $aSurveyInfo['anonymized'] != "N", $iSurveyID);
     $printanswershonorsconditions = Yii::app()->getConfig('printanswershonorsconditions');
     $aFullResponseTable = getFullResponseTable($iSurveyID, $sSRID, $sLanguage, $printanswershonorsconditions);
     //Get the fieldmap @TODO: do we need to filter out some fields?
     if ($aSurveyInfo['datestamp'] != "Y" || $sAnonymized == 'Y') {
         unset($aFullResponseTable['submitdate']);
     } else {
         unset($aFullResponseTable['id']);
     }
     unset($aFullResponseTable['token']);
     unset($aFullResponseTable['lastpage']);
     unset($aFullResponseTable['startlanguage']);
     unset($aFullResponseTable['datestamp']);
     unset($aFullResponseTable['startdate']);
     $sOutput .= "<table class='printouttable' >\n";
     foreach ($aFullResponseTable as $sFieldname => $fname) {
         if (substr($sFieldname, 0, 4) == 'gid_') {
             $sOutput .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n";
         } elseif (substr($sFieldname, 0, 4) == 'qid_') {
//.........这里部分代码省略.........
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:101,代码来源:PrintanswersController.php


示例7: pdf

					}
					else
						$i=$sep+1;
					$sep=-1;
					$j=$i;
					$l=0;
					$nl++;
				}
				else
					$i++;
			}
			return $nl;
		}
	}
	
	$pdf = new pdf('L','mm','A4');
	$pdf->AliasNbPages();
	$titulos = array('FECHA','F. RECEPCION','SUCURSAL','GUIA','ORIGEN','DESTINO','INCIDENTE','RECIBIO','UNIDAD','RUTA');
	$medidas = array(15,20,15,22,12,12,30,80,20,55);
	$pdf->AddPage();
	
	$pdf->SetFont('Arial','B',7);
	//Table with 20 rows and 4 columns
	
	$pdf->SetWidths($medidas);
	
	$pdf->Titulos($titulos,$medidas);
	
	$pdf->SetFont('Arial','',7);
	for($i=0;$i<count($data);$i++){
		$pdf->Row($data[$i]);
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:31,代码来源:danosFaltantes.php


示例8: defined

<?php

/**
* @version		1.5.0
* @package		Fi pdf
* @copyright	Copyright (C) 2012 Fiyo Developers.
* @license		GNU/GPL, see LICENSE.txt
**/
defined('_FINDEX_') or die('Access Denied');
$pdf = new pdf();
$pdf->category(app_param('label'), Page_ID, 1);
if (isset($pdf->category)) {
    $category = $pdf->category;
    $catlink = $pdf->catlink;
    $text = $pdf->desc;
    $pagelink = $pdf->pglink;
    $link = $pdf->link;
    $perrows = $pdf->perrows;
    $author = $pdf->author;
    $title = $pdf->title;
    $title = $pdf->title;
    $labels = $pdf->labels;
    $hits = $pdf->hits;
    $date = $pdf->date;
    $label = ucfirst(app_param('label'));
    if ($title) {
        if (!empty($label)) {
            echo "<h1 class='title'>{$label}</h1>";
        } else {
            if (defined('Apps_Title')) {
                echo "<h1 class='title'>" . Apps_Title . "</h1>";
开发者ID:mul14,项目名称:FiyoCMS,代码行数:31,代码来源:default.php


示例9: defined

<?php

/**
* @version		1.5.0
* @package		Fi pdf
* @copyright	Copyright (C) 2012 Fiyo Developers.
* @license		GNU/GPL, see LICENSE.txt
**/
defined('_FINDEX_') or die('Access Denied');
$pdf = new pdf();
$pdf->category(app_param('id'), Page_ID);
if (isset($pdf->category)) {
    $category = $pdf->category;
    $catlink = $pdf->catlink;
    $text = $pdf->desc;
    $pagelink = $pdf->pglink;
    $link = $pdf->link;
    $perrows = $pdf->perrows;
    $author = $pdf->author;
    $title = $pdf->title;
    $title = $pdf->title;
    $labels = $pdf->labels;
    $hits = $pdf->hits;
    $date = $pdf->date;
    $label = ucfirst(app_param('label'));
    if ($title) {
        if (!empty($label)) {
            echo "<h1 class='title'>{$label}</h1>";
        } else {
            if (defined('PageTitle')) {
                echo "<h1 class='title'>" . PageTitle . "</h1>";
开发者ID:mul14,项目名称:FiyoCMS,代码行数:31,代码来源:category.php


示例10: __construct

 function __construct(CController $controller)
 {
     parent::__construct();
     $this->style = $controller->render('/admin/export/quexmlpdf_view', '', true);
 }
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:5,代码来源:quexmlpdf.php


示例11: pdf

<?php

use App\Http\Controllers\Pdf;
$pdf = new pdf();
$pdf->load();
$dompdf = new DOMPDF();
$html = '<html><body>' . '<h2>Mario Muñoz </h2>' . '<p> Primer tutorial de composer con laravel 5</p>' . '</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("report.pdf");
开发者ID:raulbravo23,项目名称:salepoint,代码行数:11,代码来源:index.php


示例12: send

 public function send($filename)
 {
     $doc = new pdf($this->orientation);
     if ($this->title) {
         $doc->setHeaderData('', 0, $this->title);
         $doc->setPrintHeader(true);
     } else {
         $doc->setPrintHeader(false);
     }
     $doc->setPrintFooter(false);
     foreach ($this->pages as $page) {
         $doc->AddPage();
         if ($page->title) {
             $doc->writeHtml('<h2>' . $page->title . '</h2>');
         }
         // Find extent of the table.
         $rows = $this->get_row_count($page);
         $cols = $this->get_col_count($page);
         $relwidths = $this->compute_relative_widths($page);
         $o = html_writer::start_tag('table', array('border' => 1, 'cellpadding' => 1));
         for ($row = 0; $row < $rows; $row++) {
             $o .= html_writer::start_tag('tr');
             $col = 0;
             while ($col < $cols) {
                 $span = 1;
                 if (isset($page->mergers[$row][$col])) {
                     $mergewidth = (int) $page->mergers[$row][$col];
                     if ($mergewidth >= 1) {
                         $span = $mergewidth;
                     }
                 }
                 $opts = array();
                 if ($row == 0 && $relwidths[$col] > 0) {
                     $opts['width'] = $relwidths[$col] . '%';
                 }
                 if ($span > 1) {
                     $opts['colspan'] = $span;
                 }
                 $o .= html_writer::start_tag('td', $opts);
                 $cell = '';
                 if (isset($page->cells[$row][$col])) {
                     $cell = s($page->cells[$row][$col]);
                     if (isset($page->formats[$row][$col])) {
                         $thisformat = $page->formats[$row][$col];
                         if ($thisformat == 'header') {
                             $cell = html_writer::tag('b', $cell);
                         } else {
                             if ($thisformat == 'boldit') {
                                 $cell = html_writer::tag('i', $cell);
                             }
                         }
                     }
                 }
                 $o .= $cell;
                 $o .= html_writer::end_tag('td');
                 $col += $span;
             }
             $o .= html_writer::end_tag('tr');
         }
         $o .= html_Writer::end_tag('table');
         $doc->writeHtml($o);
     }
     $doc->Output($filename . '.pdf');
 }
开发者ID:ninelanterns,项目名称:moodle-mod_scheduler,代码行数:64,代码来源:exportlib.php


示例13: test_gs_path

 /**
  * Test that the configured path to ghostscript is correct and working.
  * @param bool $generateimage - If true - a test image will be generated to verify the install.
  * @return bool
  */
 public static function test_gs_path($generateimage = true)
 {
     global $CFG;
     $ret = (object) array('status' => self::GSPATH_OK, 'message' => null);
     $gspath = \get_config('assignfeedback_editpdf', 'gspath');
     if (empty($gspath)) {
         $ret->status = self::GSPATH_EMPTY;
         return $ret;
     }
     if (!file_exists($gspath)) {
         $ret->status = self::GSPATH_DOESNOTEXIST;
         return $ret;
     }
     if (is_dir($gspath)) {
         $ret->status = self::GSPATH_ISDIR;
         return $ret;
     }
     if (!is_executable($gspath)) {
         $ret->status = self::GSPATH_NOTEXECUTABLE;
         return $ret;
     }
     $testfile = $CFG->dirroot . '/mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf';
     if (!file_exists($testfile)) {
         $ret->status = self::GSPATH_NOTESTFILE;
         return $ret;
     }
     if (!$generateimage) {
         return $ret;
     }
     $testimagefolder = \make_temp_directory('assignfeedback_editpdf_test');
     @unlink($testimagefolder . '/image_page0.png');
     // Delete any previous test images.
     $pdf = new pdf();
     $pdf->set_pdf($testfile);
     $pdf->set_image_folder($testimagefolder);
     try {
         $pdf->get_image(0);
     } catch (\moodle_exception $e) {
         $ret->status = self::GSPATH_ERROR;
         $ret->message = $e->getMessage();
     }
     return $ret;
 }
开发者ID:covex-nn,项目名称:moodle,代码行数:48,代码来源:pdf.php


示例14: pdf

				}
				if($c==' ')
					$sep=$i;
				$l+=$cw[$c];
				if($l>$wmax)
				{
					if($sep==-1)
					{
						if($i==$j)
							$i++;
					}
					else
						$i=$sep+1;
					$sep=-1;
					$j=$i;
					$l=0;
					$nl++;
				}
				else
					$i++;
			}
			return $nl;
		}
	}
	
	$pdf = new pdf();
	$pdf->AliasNbPages();
	$pdf->AddPage();
	$pdf->adddetalle();
	$pdf->Output();	
?>
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:31,代码来源:ejemplo2.php


示例15: pdf

					}
					else
						$i=$sep+1;
					$sep=-1;
					$j=$i;
					$l=0;
					$nl++;
				}
				else
					$i++;
			}
			return $nl;
		}
	}
	
	$pdf = new pdf('L','mm','Legal');
	$pdf->AliasNbPages();
	$titulos = array('GUIA','FECHA','FLETE','DESCUENTO','FLETE NETO','COMISION','RECOLECCION','COMISION RAD','ENTREGA','COMISION EAD','COM. SOBREPESO','TOTAL','TOTAL GRAL','CONDICION','STATUS');
	$medidas = array(22,15,20,20,25,20,20,20,20,20,20,35,35,25,40);
	$pdf->AddPage();
	$pdf->SetFont('Arial','B',6);	
	
	$pdf->SetWidths($medidas);
	
	$pdf->Titulos($titulos,$medidas);
	
	$pdf->SetFont('Arial','',6);
	for($i=0;$i<count($data);$i++){
		$pdf->Row($data[$i]);
	}
	
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:30,代码来源:ventasRealizadas.php


示例16: actionView

 /**
  * printanswers::view()
  * View answers at the end of a survey in one place. To export as pdf, set 'usepdfexport' = 1 in lsconfig.php and $printableexport='pdf'.
  * @param mixed $surveyid
  * @param bool $printableexport
  * @return
  */
 function actionView($surveyid, $printableexport = FALSE)
 {
     global $siteadminname, $siteadminemail;
     Yii::app()->loadHelper("frontend");
     Yii::import('application.libraries.admin.pdf');
     $surveyid = (int) $surveyid;
     Yii::app()->loadHelper('database');
     if (isset($_SESSION['survey_' . $surveyid]['sid'])) {
         $surveyid = $_SESSION['survey_' . $surveyid]['sid'];
     } else {
         die('Invalid survey/session');
     }
     //Debut session time out
     if (!isset($_SESSION['survey_' . $surveyid]['finished']) || !isset($_SESSION['survey_' . $surveyid]['srid'])) {
         //require_once($rootdir.'/classes/core/language.php');
         $baselang = Survey::model()->findByPk($surveyid)->language;
         Yii::import('application.libraries.Limesurvey_lang', true);
         $clang = new Limesurvey_lang($baselang);
         //A nice exit
         sendCacheHeaders();
         doHeader();
         echo templatereplace(file_get_contents(getTemplatePath(validateTemplateDir("default")) . "/startpage.pstpl"), array(), array());
         echo "<center><br />\n" . "\t<font color='RED'><strong>" . $clang->gT("Error") . "</strong></font><br />\n" . "\t" . $clang->gT("We are sorry but your session has expired.") . "<br />" . $clang->gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.") . "<br />\n" . "\t" . sprintf($clang->gT("Please contact %s ( %s ) for further assistance."), $siteadminname, $siteadminemail) . "\n" . "</center><br />\n";
         echo templatereplace(file_get_contents(getTemplatePath(validateTemplateDir("default")) . "/endpage.pstpl"), array(), array());
         doFooter();
         exit;
     }
     //Fin session time out
     $id = $_SESSION['survey_' . $surveyid]['srid'];
     //I want to see the answers with this id
     $clang = $_SESSION['survey_' . $surveyid]['s_lang'];
     //Ensure script is not run directly, avoid path disclosure
     //if (!isset($rootdir) || isset($_REQUEST['$rootdir'])) {die( "browse - Cannot run this script directly");}
     // Set the language for dispay
     //require_once($rootdir.'/classes/core/language.php');  // has been secured
     if (isset($_SESSION['survey_' . $surveyid]['s_lang'])) {
         $clang = SetSurveyLanguage($surveyid, $_SESSION['survey_' . $surveyid]['s_lang']);
         $language = $_SESSION['survey_' . $surveyid]['s_lang'];
     } else {
         $language = Survey::model()->findByPk($surveyid)->language;
         $clang = SetSurveyLanguage($surveyid, $language);
     }
     // Get the survey inforamtion
     $thissurvey = getSurveyInfo($surveyid, $language);
     //SET THE TEMPLATE DIRECTORY
     if (!isset($thissurvey['templatedir']) || !$thissurvey['templatedir']) {
         $thistpl = validateTemplateDir("default");
     } else {
         $thistpl = validateTemplateDir($thissurvey['templatedir']);
     }
     if ($thissurvey['printanswers'] == 'N') {
         die;
         //Die quietly if print answers is not permitted
     }
     //CHECK IF SURVEY IS ACTIVATED AND EXISTS
     $surveytable = "{{survey_{$surveyid}}}";
     $surveyname = $thissurvey['surveyls_title'];
     $anonymized = $thissurvey['anonymized'];
     //OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK.
     //SHOW HEADER
     $printoutput = '';
     $printoutput .= "<form action='" . Yii::app()->getController()->createUrl('printanswers/view/surveyid/' . $surveyid . '/printableexport/pdf') . "' method='post'>\n<center><input type='submit' value='" . $clang->gT("PDF export") . "'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";
     if ($printableexport == 'pdf') {
         require Yii::app()->getConfig('rootdir') . '/application/config/tcpdf.php';
         Yii::import('application.libraries.admin.pdf', true);
         $pdf = new pdf();
         $pdf->setConfig($tcpdf);
         //$pdf->SetFont($pdfdefaultfont,'',$pdffontsize);
         $pdf->AddPage();
         //$pdf->titleintopdf($clang->gT("Survey name (ID)",'unescaped').": {$surveyname} ({$surveyid})");
         $pdf->SetTitle($clang->gT("Survey name (ID)", 'unescaped') . ": {$surveyname} ({$surveyid})");
     }
     $printoutput .= "\t<div class='printouttitle'><strong>" . $clang->gT("Survey name (ID):") . "</strong> {$surveyname} ({$surveyid})</div><p>&nbsp;\n";
     LimeExpressionManager::StartProcessingPage(true);
     // means that all variables are on the same page
     // Since all data are loaded, and don't need JavaScript, pretend all from Group 1
     LimeExpressionManager::StartProcessingGroup(1, $thissurvey['anonymized'] != "N", $surveyid);
     $aFullResponseTable = getFullResponseTable($surveyid, $id, $language, true);
     //Get the fieldmap @TODO: do we need to filter out some fields?
     unset($aFullResponseTable['id']);
     unset($aFullResponseTable['token']);
     unset($aFullResponseTable['lastpage']);
     unset($aFullResponseTable['startlanguage']);
     unset($aFullResponseTable['datestamp']);
     unset($aFullResponseTable['startdate']);
     $printoutput .= "<table class='printouttable' >\n";
     if ($printableexport == 'pdf') {
         $pdf->intopdf($clang->gT("Question", 'unescaped') . ": " . $clang->gT("Your answer", 'unescaped'));
     }
     $oldgid = 0;
     $oldqid = 0;
     foreach ($aFullResponseTable as $sFieldname => $fname) {
         if (substr($sFieldname, 0, 4) == 'gid_') {
//.........这里部分代码省略.........
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:101,代码来源:PrintanswersController.php


示例17: UCASE

	gc.colonia, gc.cp, gc.poblacion, gc.municipio, gc.estado, gc.pais, gc.celular, gc.telefono, gc.email,
	gc.precioporkg, gc.precioporcaja, gc.descuentosobreflete, gc.cantidaddescuento, gc.limitekg, gc.costo,
	gc.preciokgexcedente, gc.prepagadas, gc.consignacionkg, gc.consignacioncaja, gc.consignaciondescuento,
	gc.consignaciondescantidad, gc.valordeclarado, limite, porcada, costoextra,
	date_format(current_date, '%d/%m/%Y') as fechaactual,
	cs.estado eest, cs.municipio emun, gc.legal,
	CONCAT(day(gc.fecha),' de ', UCASE(MONTHNAME(gc.fecha)), ' de ',YEAR(gc.fecha)) fechaconvenio,
	CONCAT(day(gc.vigencia),' de ', UCASE(MONTHNAME(gc.vigencia)), ' de ',YEAR(gc.vigencia)) fechavigencia
	FROM generacionconvenio gc
	LEFT JOIN catalogosucursal cs ON gc.sucursal = cs.id
	WHERE gc.folio = '$_GET[folio]'";
	$r = mysql_query($s,$l) or die("error ".mysql_error($l)."--".$s);
	$f = mysql_fetch_object($r);
	//die($s);
	
	$pdf = new pdf();
	$pdf->AliasNbPages();
	$pdf -> AddPage();
	$pdf -> Ln(10);
	$pdf -> SetFont("Arial","",8);
	
	
	$contenido = 'Contrato de prestación de servicios que celebra por una parte ENTREGAS PUNTUALES S DE RL DE CV, a quien en lo sucesivo se le denominará "La Prestadora de Servicios", y por otra parte '.$f->ncliente.' representada por '.ucwords($f->legal).' a quien en lo sucesivo se le denominará "El Cliente".
	
	1.- La Prestadora de Servicios otorgará a "El Cliente" los siguientes servicios:
	                Guias Ventanilla                    Guias Electronicas
	                Entrega a Domicilio                 Recolección a Domicilio
	                Valor Declarado                     Acuse de Recibo
	                Entregas a Subdestinos
					
	2.- El precio del servicio de Recolección a Domicilio (RAD) y Entrega a Domicilio (EAD) es un 10% sobre el valor del flete o bien un cobro mínimo dependiendo de la Ciudad donde se origine el servicio de RAD o donde se envíe el servicio de EAD (ver tarifas).
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:31,代码来源:convenio_nuevo.php


示例18: print_qrcode

 /**
  * Put a QR code in cerficate pdf object
  * 
  * @param pdf $pdf The pdf object
  * @param string $code The certificate code
  */
 protected function print_qrcode($pdf, $code)
 {
     global $CFG;
     $style = array('border' => 2, 'vpadding' => 'auto', 'hpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'module_width' => 1, 'module_height' => 1);
     // height of a single module in points
     $codeurl = new moodle_url("{$CFG->wwwroot}/mod/simplecertificate/verify.php");
     $codeurl->param('code', $code);
     $pdf->write2DBarcode($codeurl->out(false), 'QRCODE,M', $this->get_instance()->codex, $this->get_instance()->codey, 50, 50, $style, 'N');
     $pdf->SetXY($this->get_instance()->codex, $this->get_instance()->codey + 49);
     $pdf->SetFillColor(255, 255, 255);
     $pdf->Cell(50, 0, $code, 'LRB', 0, 'C', true, '', 2);
 }
开发者ID:seducto,项目名称:moodle-mod_simplecertificate,代码行数:18,代码来源:locallib.php


示例19: actionView

 /**
  * printanswers::view()
  * View answers at the end of a survey in one place. To export as pdf, set 'usepdfexport' = 1 in lsconfig.php and $printableexport='pdf'.
  * @param mixed $surveyid
  * @param bool $printableexport
  * @return
  */
 function actionView($surveyid, $printableexport = FALSE)
 {
     Yii::app()->loadHelper("frontend");
     Yii::import('application.libraries.admin.pdf');
     $iSurveyID = (int) $surveyid;
     $sExportType = $printableexport;
     Yii::app()->loadHelper('database');
     if (isset($_SESSION['survey_' . $iSurveyID]['sid'])) {
         $iSurveyID = $_SESSION['survey_' . $iSurveyID]['sid'];
     } else {
         //die('Invalid survey/session');
     }
     // Get the survey inforamtion
     // Set the language for dispay
     if (isset($_SESSION['survey_' . $iSurveyID]['s_lang'])) {
         $sLanguage = $_SESSION['survey_' . $iSurveyID]['s_lang'];
     } elseif (Survey::model()->findByPk($iSurveyID)) {
         $sLanguage = Survey::model()->findByPk($iSurveyID)->language;
     } else {
         $iSurveyID = 0;
         $sLanguage = Yii::app()->getConfig("defaultlang");
     }
     SetSurveyLanguage($iSurveyID, $sLanguage);
     $aSurveyInfo = getSurveyInfo($iSurveyID, $sLanguage);
     $oTemplate = Template::model()->getInstance(null, $iSurveyID);
     //Survey is not finished or don't exist
     if (!isset($_SESSION['survey_' . $iSurveyID]['finished']) || !isset($_SESSION['survey_' . $iSurveyID]['srid'])) {
         sendCacheHeaders();
         doHeader();
         /// $oTemplate is a global variable defined in controller/survey/index
         echo templatereplace(file_get_contents($oTemplate->viewPath . '/startpage.pstpl'), array());
         echo "<center><br />\n" . "\t<font color='RED'><strong>" . gT("Error") . "</strong></font><br />\n" . "\t" . gT("We are sorry but your session has expired.") . "<br />" . gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.") . "<br />\n" . "\t" . sprintf(gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail")) . "\n" . "</center><br />\n";
         echo templatereplace(file_get_contents($oTemplate->viewPath . '/endpage.pstpl'), array());
         doFooter();
         exit;
     }
     //Fin session time out
     $sSRID = $_SESSION['survey_' . $iSurveyID]['srid'];
     //I want to see the answers with this id
     //Ensure script is not run directly, avoid path disclosure
     //if (!isset($rootdir) || isset($_REQUEST['$rootdir'])) {die( "browse - Cannot run this script directly");}
     //Ensure Participants printAnswer setting is set to true or that the logged user have read permissions over the responses.
     if ($aSurveyInfo['printanswers'] == 'N' && !Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'read')) {
         throw new CHttpException(401, 'You are not allowed to print answers.');
     }
     //CHECK IF SURVEY IS ACTIVATED AND EXISTS
     $sSurveyName = $aSurveyInfo['surveyls_title'];
     $sAnonymized = $aSurveyInfo['anonymized'];
     //OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK.
     //SHOW HEADER
     if ($sExportType != 'pdf') {
         $sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post') . "<center><input class='btn btn-default' type='submit' value='" . gT("PDF export") . "'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";
         $sOutput .= "\t<div class='printouttitle'><strong>" . gT("Survey name (ID):") . "</strong> {$sSurveyName} ({$iSurveyID})</div><p>&nbsp;\n";
         LimeExpressionManager::StartProcessingPage(true);
         // means that all variables are on the same page
         // Since all data are loaded, and don't need JavaScript, pretend all from Group 1
         LimeExpressionManager::StartProcessingGroup(1, $aSurveyInfo['anonymized'] != "N", $iSurveyID);
         $printanswershonorsconditions = Yii::app()->getConfig('printanswershonorsconditions');
         $aFullResponseTable = getFullResponseTable($iSurveyID, $sSRID, $sLanguage, $printanswershonorsconditions);
         //Get the fieldmap @TODO: do we need to filter out some fields?
         if ($aSurveyInfo['datestamp'] != "Y" || $sAnonymized == 'Y') {
             unset($aFullResponseTable['submitdate']);
         } else {
             unset($aFullResponseTable['id']);
         }
         unset($aFullResponseTable['token']);
         unset($aFullResponseTable['lastpage']);
         unset($aFullResponseTable['startlanguage']);
         unset($aFullResponseTable['datestamp']);
         unset($aFullResponseTable['startdate']);
         $sOutput .= "<table class='printouttable' >\n";
         foreach ($aFullResponseTable as $sFieldname => $fname) {
             if (substr($sFieldname, 0, 4) == 'gid_') {
                 $sOutput .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n";
                 $sOutput .= "\t<tr class='printanswersgroupdesc'><td colspan='2'>{$fname[1]}</td></tr>\n";
             } elseif ($sFieldname == 'submitdate') {
                 if ($sAnonymized != 'Y') {
                     $sOutput .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]} {$sFieldname}</td><td class='printanswersanswertext'>{$fname[2]}</td></tr>";
                 }
             } elseif (substr($sFieldname, 0, 4) != 'qid_') {
                 $sOutput .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]}</td><td class='printanswersanswertext'>" . flattenText($fname[2]) . "</td></tr>";
             }
         }
         $sOutput .= "</table>\n";
         $sData['thissurvey'] = $aSurveyInfo;
         $sOutput = templatereplace($sOutput, array(), $sData, '', $aSurveyInfo['anonymized'] == "Y", NULL, array(), true);
         // Do a static replacement
         ob_start(function ($buffer, $phase) {
             App()->getClientScript()->render($buffer);
             App()->getClientScript()->reset();
             return $buffer;
         });
   

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pdo类代码示例发布时间:2022-05-23
下一篇:
PHP pc_base类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap