Zend framework 如何在Zend框架中将动作输出传递给TCPDF
嗨,我是zend框架的新手。我正在zend框架中使用TCPDF。我在以pdf格式打印内容时遇到问题 我在控制器中编写了以下代码:Zend framework 如何在Zend框架中将动作输出传递给TCPDF,zend-framework,tcpdf,Zend Framework,Tcpdf,嗨,我是zend框架的新手。我正在zend框架中使用TCPDF。我在以pdf格式打印内容时遇到问题 我在控制器中编写了以下代码: $html = ob_get_clean(); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pd
$html = ob_get_clean();
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Test');
$pdf->SetTitle('Test');
$pdf->SetSubject('Test');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, 20, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(20);
$pdf->SetFooterMargin(25);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('dejavusans', '', 8, '', true);
$pdf->AddPage();
$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
$pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
$datetime=date("Y-m-d h:i:s");
$pdf->Output('MIS_Report_'.$datetime.'.pdf', 'I');
我已经把我的内容写在视图文件夹中的phtml文件中,该文件夹将显示在pdf上
当我运行代码时。它将向我显示pdf,但不显示任何内容。
如果您不需要布局,请帮助我
$this->_helper->layout()->disableLayout();
$html = $this->view->render('controllername/actionname.phtml');
我还有一个问题,当我将数据从数据库传递到pdf的phtml文件时,它会给出一个错误“未定义索引:第21971行/cmiportal/cm/cmi013/library/tcpdf/tcpdf.php中的cols”