I have tested PHP file to show PDF from sample.html.
What is issue with PHP? can be improved?
<?
require('html2fpdf/html2pdf.class.php');
$pdf=new HTML2FPDF();
$pdf->AddPage();
$fp = fopen("html2fpdf/sample.html","r");
$strContent = fread($fp, filesize("sample.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
if(file_exists("sample.pdf")) unlink("sample.pdf");
$pdf->Output("sample.pdf");
$msg = "PDF file is generated successfully!";
header("location:http://www.mydomain/index.php?page=".$_REQUEST['page']."&msg=".$msg);
exit;
?>
Error is the following:
Warning: require_once(/.../html2fpdf/_class/exception.class.php) [function.require-once]: failed to open stream: No such file or directory in /.../html2fpdf/html2pdf.class.php on line 17
Fatal error: require_once() [function.require]: Failed opening required '/.../html2fpdf/_class/exception.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /...//html2fpdf/html2pdf.class.php on line 17
Need to test basic concepts and working HTML to PDF.