Page 1 of 1

dompdf

Posted: Thu Jul 31, 2008 9:38 pm
by junjustkim
hi to all

I used dompdf to convert my form into pdf. the problem is I have an error using $smarty->fetch(). Any suggestion is greatly appreciated.

Thanks in advance

here is the error:
Warning: Missing argument 1 for Smarty::fetch(), called in C:\xampp\htdocs\infinity_other\form_output\submit_form2.php on line 8 and defined in C:\xampp\htdocs\infinity_other\include\smarty.class.php on line 1116

Code: Select all

<?
  require_once("../include/session.php");
  global $session;
 
  require("../include/smarty.class.php");
  $smarty = new smarty;
  $tmpfile = tempnam("infinity_other/form_output", "dompdf_");
  file_put_contents($tmpfile,$smarty->fetch()); // Replace $smarty->fetch()
                                                // with your HTML string
 
  $url = "infinity_other/dompdf-0.5.1/dompdf.php?input_file=" . rawurlencode($tmpfile) .
       "&paper=letter&output_file=" . rawurlencode("PDF.pdf");
 
  header("Location: http://" . $_SERVER["HTTP_HOST"] . "/$url");
 
?>

Re: dompdf

Posted: Fri Aug 01, 2008 8:14 pm
by EverLearning
$smarty->fetch() expects the name of the smarty template you want converted as an argument, and you're not passing any.