HTML to PDF
Posted: Sat Mar 10, 2007 2:17 pm
I am trying to use the HTML to PDF class here:
http://html2fpdf.sourceforge.net/
I can get it to make the file fine, but it doesn't display the PDF file, it makes it so you download it, when its suppost to just display the file.... here is my code... PS. There is an auto_append and auto_prepend so i have to cancel them out
http://html2fpdf.sourceforge.net/
I can get it to make the file fine, but it doesn't display the PDF file, it makes it so you download it, when its suppost to just display the file.... here is my code... PS. There is an auto_append and auto_prepend so i have to cancel them out
Code: Select all
<?
ob_end_clean();
require_once('html2fpdf.php');
require_once('function.php');
define('HTML_URL','http://google.com/');
$html = get_url_contents(HTML_URL);
ob_end_clean();
$pdf = new HTML2FPDF();
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($html);
$pdf->Output('doc.pdf','I');
?>How do I get it to display the PDF file in the webpage window?function.php wrote:Code: Select all
<?php function get_url_contents($url){ $crl = curl_init(); $timeout = 5; curl_setopt ($crl, CURLOPT_URL,$url); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec($crl); curl_close($crl); return $ret; } ?>