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


PHP Pdf::render方法代码示例

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


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

示例1: actionImprimir

 public function actionImprimir()
 {
     // get your HTML raw content without any layouts or scrip
     $pasostramite = pasostramite::find()->all();
     $content = $this->renderPartial('_imprimir', ['pasostramite' => $pasostramite]);
     $header = $this->renderPartial('_header', ['pasostramite' => $pasostramite]);
     $pdf = new Pdf(['format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'content' => $content, 'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css', 'cssInline' => '.kv-heading-1{font-size:18px}', 'options' => ['title' => 'Krajee Report Title'], 'methods' => ['SetHeader' => $header, 'SetFooter' => ['{PAGENO}']]]);
     // return the pdf output as per the destination setting
     return $pdf->render();
 }
开发者ID:rzamarripa,项目名称:du,代码行数:10,代码来源:PasosTramiteController.php

示例2: actionImprimirFiltro

 public function actionImprimirFiltro()
 {
     //echo'<pre>';print_r($_GET);echo'</pre>'; exit;
     $fechaInicial = date("d-m-Y", strtotime($_GET['fechas']["filtro"]["fechaInicial"]));
     $fechaFinal = date("d-m-Y", strtotime($_GET['fechas']["filtro"]["fechaFinal"]));
     $formato = 'fecha_ft >= "' . $fechaInicial . '" and fecha_ft <= "' . $fechaFinal . '"';
     $VisitasEscuelas = VisitasEscuelas::find()->where('fecha_ft >= :fechaInicial and fecha_ft <= :fechaFinal', ['fechaInicial' => $fechaInicial, 'fechaFinal' => $fechaFinal])->all();
     $content = $this->renderPartial('_imprimir', ['VisitasEscuelas' => $VisitasEscuelas]);
     $header = $this->renderPartial('_header', ['VisitasEscuelas' => $VisitasEscuelas]);
     $pdf = new Pdf(['format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'content' => $content, 'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css', 'cssInline' => '.kv-heading-1{font-size:18px}', 'options' => ['title' => 'Krajee Report Title'], 'methods' => ['SetHeader' => $header, 'SetFooter' => ['{PAGENO}']]]);
     // return the pdf output as per the destination setting
     return $pdf->render();
 }
开发者ID:rzamarripa,项目名称:du,代码行数:13,代码来源:VisitasEscuelasController.php

示例3: testEmbedHtmlImage

 function testEmbedHtmlImage()
 {
     // NOTE: to embed images, use <img src=""> tag but specify a path to an existing file
     $model = new \Core3\Model\Spreadsheet();
     $model->defineColumns(array('id', 'name'));
     $model->addRow(array('1', 'kalle'));
     $model->addRow(array('2', 'olle'));
     $imgFile = tempnam('/tmp', 'embedHtmlImage');
     $this->createJpeg($imgFile);
     $writer = new Pdf();
     $writer->setStartHtmlBlock('<img src="' . $imgFile . '"/><br/>');
     $writer->setEndHtmlBlock('<h2>GOODBYE</h2>');
     $data = $writer->render($model);
     unlink($imgFile);
     $reader = new \Core3\Reader\BinaryData\Document();
     $this->assertEquals(true, $reader->isRecognized($data));
     $this->assertEquals(true, $reader->isPdfData($data));
 }
开发者ID:martinlindhe,项目名称:core3,代码行数:18,代码来源:PdfTest.php


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