Hi
I have a php script that reads in the contents of an existing html file and saves it to a variable called $home_page.
For a test I displayed this by printing variable out and the output displays as expected.
Then using fpdf I wrote this variable out to create a pdf and email it.
'When I received the pdf the output I get is the contents of the html file raw code instead of the displayed output.
How do I resolve this?
require("fpdf.php");
$the_file = "/temp/your-app-test.html";
$myfile = fopen($the_file, "r") or die("Unable to open file!!!!<br><br><br>");
$homepage = file_get_contents($the_file);
fclose($myfile);
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',9);
$pdf->Cell(40,10, $homepage);
$pdf->Output();
etc...
etc..
code to email pdf