3 * patTemplate output filter that creates PDF files from latex
5 * $Id: PdfLatex.php 440 2008-03-30 09:00:16Z fishbone $
9 * @author Stephan Schmidt <schst@php.net>
13 * patTemplate output filter that creates PDF files from latex
15 * $Id: PdfLatex.php 440 2008-03-30 09:00:16Z fishbone $
17 * @package patTemplate
19 * @author Stephan Schmidt <schst@php.net>
21 class patTemplate_OutputFilter_PdfLatex extends patTemplate_OutputFilter
26 * This has to be set in the final
31 var $_name = 'PdfLatex';
42 * @return string compressed data
44 function apply( $data )
46 $cacheFolder = $this->getParam('cacheFolder');
47 $texFile = tempnam($cacheFolder, 'pt_tex_') . '.tex';
48 $fp = fopen($texFile, 'w');
52 $command = 'pdflatex --interaction=nonstopmode '.$texFile;
56 $pdf = $texFile . '.pdf';
57 $pdf = file_get_contents($pdf);