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
?>
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.