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


PHP mPDF::setSubject方法代码示例

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


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

示例1: ActionCreatePDF

 public function ActionCreatePDF($id)
 {
     $mpdf = Yii::app()->ePdf->mpdf();
     $model_historia = $this->loadModel($id);
     $model_historiaO_paciente = HistoriaObstetricia::model()->getHistoriasObstetriciaByPaciente($model_historia->paciente->id);
     $model_historiaG_paciente = HistoriaGinecologia::model()->getHistoriasGinecologicasByPaciente($model_historia->paciente->id);
     $historia = array($model_historiaG_paciente, $model_historiaO_paciente);
     $stylesheet = file_get_contents('C:\\wamp\\www\\Gineobs\\themes\\hebo\\css\\pdfMain.css');
     //configurando pdf general
     $mpdf = new mPDF('utf-8', 'Letter-L');
     //agregando header y footer
     $mpdf->SetHeader('{DATE j-m-Y}||Recipe #' . $model_historia->paciente->id);
     $mpdf->SetFooter('Dr. María Hernández|Ginecologia y obstetricia|{PAGENO}');
     //Propiedades del PDF
     $mpdf->setTitle("Historia Medica");
     $mpdf->setAuthor("María Hernández");
     $mpdf->setCreator("Edgar Cardona y Gabriela Soto");
     $mpdf->setSubject("Historia medica de pacientes.");
     $mpdf->setKeywords("Historia,Medicina");
     //escribiendo CSS
     $mpdf->WriteHTML($stylesheet, 1);
     //Escribiendo PDF
     $mpdf->writeHTML($this->renderPartial('historia', array('model' => $model_historia->paciente->id, 'historia' => $historia), true), 2);
     //Salida
     $mpdf->output("Recipe Medico", EYiiPdf::OUTPUT_TO_DOWNLOAD);
 }
开发者ID:edarkzero,项目名称:GineObs,代码行数:26,代码来源:HistoriaGinecologiaController.php

示例2: nitro_render_pdf

    protected function nitro_render_pdf($quizid, $userid, $cm)
    {
        global $CFG, $DB, $PAGE, $OUTPUT, $USER, $SESSION, $CM;
        $PAGE->requires->jquery();
        //disable SUBMIT button after click on this button
        echo '<script>document.getElementById("nitro_submit").disabled=true;</script>';
        //define where is storage WIRIS image
        $WIRIS_URL_IMAGE_SERVICE = $CFG->wwwroot . '/question/type/wq/quizzes/service.php?service=cache&name=';
        //GENERATE HTML FILE? DEFAULT IS FALSE
        $generate_html_file = true;
        $html_contents = '';
        //numbers of parts of the report
        $PROGRESSBAR_PARTS = 9;
        //get information about quiz, if quiz info is empty - quiz doesn't exists
        $info_quiz = $this->nitro_get_quiz($quizid);
        $this->SetBarWidth(0);
        @ob_flush();
        @flush();
        //context
        $context = context_module::instance($cm->id);
        $contexts_array = explode('/', $context->path);
        unset($contexts_array[0], $contexts_array[1]);
        arsort($contexts_array);
        $contexts_array_tmp = '';
        foreach ($contexts_array as $id => $val) {
            $contexts_array_tmp .= '"' . $val . '",';
        }
        $contexts_array = substr($contexts_array_tmp, 0, -1);
        //context end
        //mode note - 1 - error in all answer, 2 - error half answer
        $MODE_NOTE = 2;
        if (isset($_POST['evaluation_nopart']) && $_POST['evaluation_nopart'] == 1) {
            $MODE_NOTE = 1;
        }
        // generate_excel_files
        $GENERATE_EXCEL = false;
        if (isset($_POST['generate_excel_files']) && $_POST['generate_excel_files'] == 1) {
            $GENERATE_EXCEL = true;
        }
        //if info quiz is empty, show error
        if (empty($info_quiz)) {
            print_error('quizdoesntexists', 'quiz_nitroreportpdf', new moodle_url('/mod/quiz/report.php?id=' . $cm->id . '&mode=nitroreportpdf'));
        } else {
            //get info about course
            $info_course = $this->nitro_get_course($info_quiz->course);
            //specifies the number of decimal places. If the quiz that did not specify, the default is the number 4
            $decimalpoints = $info_quiz->decimalpoints >= 0 ? $info_quiz->decimalpoints : 4;
            $questiondecimalpoints = $info_quiz->questiondecimalpoints >= 0 ? $info_quiz->questiondecimalpoints : 2;
            /*
            	quiz array. Specify correct questions & answers.
            */
            $tab_quiz = array();
            if ($GENERATE_EXCEL) {
                $objPHPExcel = new PHPExcel();
                $objPHPExcel->getProperties()->setCategory("Statistic Report for Moodle Quiz")->setCompany("Jarosław Maciejewski")->setCreator("Moodle - Quiz Nitro Report PDF module")->setLastModifiedBy("Moodle - Quiz Nitro Report PDF module")->setTitle("Short statistic of test from Moodle")->setSubject("Short statistic of test from Moodle")->setDescription("Show statistic report from Moodle Quiz")->setKeywords("quiz; report; pdf; statistic;");
            }
            //GENERATE PDF
            $mpdf = new mPDF('times');
            $mpdf->useAdobeCJK = true;
            $stylesheet = file_get_contents($CFG->dirroot . '/mod/quiz/report/nitroreportpdf/style.css');
            $mpdf->WriteHTML($stylesheet, 1);
            $mpdf->setKeywords('egzamin,moodle,jaroslaw,maciejewski');
            $mpdf->setSubject(get_string('exams_on_moodle', 'quiz_nitroreportpdf'));
            $mpdf->setCreator(get_string('moodle', 'quiz_nitroreportpdf'));
            $mpdf->setAuthor('Jarosław Maciejewski');
            $mpdf->SetProtection(array('print', 'print-highres'));
            $mpdf->setTitle(get_string('exam_result', 'quiz_nitroreportpdf'));
            // PDF HEADER
            $mpdf->setHTMLHeader('<span style="font-size: 10pt;">' . get_string('protocol_exam', 'quiz_nitroreportpdf') . ': ' . $info_quiz->name . ' ' . get_string('of_course', 'quiz_nitroreportpdf') . ' ' . $info_course->fullname . '</span><hr />');
            // PDF FOOTER
            $mpdf->setHTMLFooter('<hr />
			<table width="100%" border="0">
				<tr>
					<td style="font-size: 10pt;text-align: center;">' . get_string('page', 'quiz_nitroreportpdf') . ' {PAGENO}/{nb}</td>
					<td style="font-size: 10pt;text-align: right;width: 20%;">{DATE d.m.Y H:i}</td>
				</tr>
			</table>
			<table width="100%" border="0">
				<tr>
					<td style="font-size: 8pt;text-align: center;">' . get_string('gen_npdf', 'quiz_nitroreportpdf') . '</td>
				</tr>
			</table>');
            $mpdf->setAutoTopMargin = 'pad';
            $mpdf->setAutoBottomMargin = 'pad';
            //GENERATOR MESSAGE AND PROGRESSBAR
            ?>
		<link rel="stylesheet" href="<?php 
            echo $CFG->wwwroot . '/mod/quiz/report/nitroreportpdf/css.css';
            ?>
" />
		<div id="nitroreportpdf_text" style="margin-left: auto; margin-right: auto;text-align: center;">
		<br /><br /><br /><br /><b><?php 
            echo get_string('gen_pleasewait', 'quiz_nitroreportpdf');
            ?>
</b></div><br />
		<div id="nitroreportpdf_progress" class="nitroreportpdf_graph" style=" margin-left: auto ; margin-right: auto;">
			<div id="nitroreportpdf_bar" style="width:0%">
				<span id="nitroreportpdf_bar_text">0%</span>
			</div>
		</div>
//.........这里部分代码省略.........
开发者ID:nitro2010,项目名称:nitro_moodle_plugins,代码行数:101,代码来源:report.php

示例3: createPDF

 public function createPDF($id)
 {
     $model = $this->loadModel($id);
     $stylesheet = file_get_contents('C:\\xampp\\htdocs\\Gineobs\\themes\\hebo\\css\\pdfMain.css');
     $texto = '<div id=contenedor>';
     $texto = $texto . '<div id=columna1>';
     $texto = $texto . '<H1 class="h1PDF"> Dra. Maria C. Hernandez N.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> Ginecologo-Obstetra.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> C.C. Galeno Center Of. C8  Av. Country Club. Bna.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> Telf. 0281-2743367/0414-8240064. CM972.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> Rif: 3956719-5 MSAS 18083.</H1>';
     $texto = $texto . '</div>';
     $texto = $texto . '<div id=columna2>';
     $texto = $texto . '<H1 class="h1PDF"> Dra. Maria C. Hernandez N.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> Ginecologo-Obstetra.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> C.C. Galeno Center Of. C8  Av. Country Club. Bna.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> Telf. 0281-2743367/0414-8240064. CM972.</H1>';
     $texto = $texto . '<H1 class="h1PDF"> Rif: 3956719-5 MSAS 18083.</H1>';
     $texto = $texto . '</div>';
     $texto = $texto . '<div id=columna1>';
     $texto = $texto . '<p>Medicina: ' . $this->visualizarArreglo($model->recipeMedicinas, 'nombre') . '</p>';
     $texto = $texto . '<p>Indicaciones: ' . $model->indicaciones . ' </p>';
     $texto = $texto . '<p>Paciente: ' . Paciente::GET_NOMBRE_COMPLETO_PK($model->paciente_id) . ' </p>';
     $texto = $texto . '<p>Fecha de creacion: ' . $model->fecha . ' </p>';
     $texto = $texto . '</div>';
     $texto = $texto . '</div>';
     /* $mpdf->writeHTML(
                $this->render('create',null ,true)
        );*/
     //Propiedades del header y footer
     //            $mpdf->defaultheaderfontsize=10;
     //            $mpdf->defaultheaderfontstyle='B';
     //            $mpdf->defaultheaderline=0;
     //            $mpdf->defaultfooterfontsize=10;
     //            $mpdf->defaultfooterfontstyle='BI';
     //            $mpdf->defaultfooterline=0;
     //configurando pdf general
     $mpdf = new mPDF('utf-8', 'Letter-L');
     //agregando header y footer
     $mpdf->SetHeader('{DATE j-m-Y}||Recipe #' . $model->id);
     $mpdf->SetFooter('Dr. María Hernández|Ginecologia y obstetricia|{PAGENO}');
     //Propiedades del PDF
     $mpdf->setTitle("Recipe Medico");
     $mpdf->setAuthor("María Hernández");
     $mpdf->setCreator("Edgar Cardona y Gabriela Soto");
     $mpdf->setSubject("Recipe medico para tratamiento de pacientes.");
     $mpdf->setKeywords("Recipe,Medico");
     //escribiendo CSS
     $mpdf->WriteHTML($stylesheet, 1);
     //Escribiendo PDF
     $mpdf->writeHTML($texto, 2);
     //Salida
     $mpdf->output("Recipe Medico", EYiiPdf::OUTPUT_TO_BROWSER);
 }
开发者ID:edarkzero,项目名称:GineObs,代码行数:54,代码来源:RecipeController.php


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