return compiled(or something) HTML Code

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
abpam
Forum Newbie
Posts: 1
Joined: Sun Apr 26, 2009 7:14 am

return compiled(or something) HTML Code

Post by abpam »

Hi,
Two weeks ago I started to search HTML -> PDF Converter in PHP.
I found FPDF and, which's very good, and now I'm really close to success, but i need a function which return a compiled HTML code. Here's my code:

Code: Select all

 
<?php
include("create_text_html.php"); //Create products_mysql.html. Dont watch this it's ok
define('FPDF_FONTPATH','font/'); //In the whole internet this define is required to work the class fine
require('fpdf.php'); //Dont have to explain this
$pdf=new FPDF(); //This too
$pdf->AddFont('Verdana','','verdana.php'); //This is a function in the class and I need to add it if i want to use definite font (In my case a cyrillic Verdana)
$pdf->AddPage(); //Starts creation of new PDF doc
$pdf->SetFont('Verdana','',15); //Sets the font mationed up
$file_name = !!!ATTENTION!!!"products_mysql.html"; //A little explaining in next rows
$pdf->Cell(0,10,$file_name); //This Writes the variable
$pdf->Output('test.pdf', 'F'); //And this saves the PDF
?>
 
OK. Everything works fine except the !!!ATTENTION!!! row. My Q is which PHP function to use to return a compiled, executed(or something like this) html file.
I try with file_get contents(), but nothing. In PDF it wrote this: http://img12.imageshack.us/img12/3962/28079502.png
With file() it wrote Array(like text)
I dont know which function to use. Plese help me.
Thank u in advance.
Last edited by Benjamin on Sun Apr 26, 2009 11:55 am, edited 1 time in total.
Reason: Added code tags.
Post Reply