Example #1
0
 /**
  * getter na PDF zdrojak
  * @return string
  */
 public function getSourceCode()
 {
     try {
         $outTemp = ob_get_contents();
         ob_end_clean();
         $pdml = new PDML('P', 'pt', 'A4');
         // P and A4 should be customizable. XXX
         $pdml->compress = 0;
         $pdml->ParsePDML($this->getTAL()->execute());
         $s = $pdml->Output("", "S");
         /*priklad hlavicek:
         		Header('Content-Type: application/pdf');
         		Header('Content-Length: '.strlen($s));
         		Header('Content-disposition: inline; filename=test_faktury.pdf');
         	  	Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
           	*/
         ob_end_clean();
         ob_start();
         echo $outTemp;
         return $s;
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #2
0
function ob_pdml($buffer)
{
    $pdml = new PDML('P', 'pt', 'A4');
    // P and A4 should be customizable. XXX
    $pdml->compress = 0;
    $pdml->ParsePDML($buffer);
    $s = $pdml->Output("", "S");
    $pdfFilename = strlen(PDF_FILENAME) > 0 ? PDF_FILENAME : "doc.pdf";
    //Header('Content-Type: application/pdf');
    //Header('Content-Length: '.strlen($s));
    //Header('Content-disposition: inline; filename='. $pdfFilename);
    return $s;
}