dompdf

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

dompdf

Post 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");
 
?>
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: dompdf

Post by EverLearning »

$smarty->fetch() expects the name of the smarty template you want converted as an argument, and you're not passing any.
Post Reply