예제 #1
0
 /**
  * Renders a Fluid template and tried to put it into a pdf
  *
  * @param string $actionName If set, the view of the specified action will be rendered instead. Default is the action specified in the Request object
  * @return string PDF Raw Data
  * @api
  */
 public function render($actionName = NULL)
 {
     $this->controllerContext->getResponse()->setHeader('Content-Type', 'application/pdf');
     $htmlFromFluid = parent::render($actionName);
     $pdf = new \TYPO3\TcPdf\Pdf($this->settings['pageFormat'], $this->settings['sizeUnit'], $this->settings['pageOrientation'], TRUE, 'UTF-8', TRUE);
     $pdf->SetFont($this->settings['font']['family'], $this->settings['font']['style'], $this->settings['font']['size']);
     $pdf->AddPage();
     $pdf->writeHTML($htmlFromFluid, true, false, false, false, '');
     return $pdf->Output('', 'S');
 }
예제 #2
0
 /**
  * Renders a template.
  *
  * @param string|TemplateReferenceInterface $name A template name or a TemplateReferenceInterface instance
  * @param array $parameters An array of parameters to pass to the template
  *
  * @return string The evaluated template as a string
  *
  * @throws \RuntimeException if the template cannot be rendered
  *
  * @api
  */
 public function render($name, array $parameters = array())
 {
     $this->fluid->getTemplatePaths()->setTemplatePathAndFilename($this->load($name));
     $this->fluid->assignMultiple($parameters);
     return $this->fluid->render();
 }