views:

270

answers:

0

I am having a html page with no style attribute.HTML tags i am using are "center,line break tag, bold tag".Html page doesnot contain any table. its a simple document.I need help for:-

  1. Adding margin of 1 inch on all sides of the pdf file.
  2. I want to start every para with space of two tabs. ("&nbsp" generate space in html file but not in pdf file.)

Code i am using:--

ob_start();
// start buffering and displaying page
echo 'All the content i m fetching according my requirements';
$file_name_string=substr($guid, 0, 8);
$file_name=$file_name_string.".htm";
file_put_contents($file_name, ob_get_contents());
// end buffering and displaying page
ob_end_flush();
$output_file=$file_name_string.".pdf";
require('html2fpdf.php');
$pdf=new HTML2FPDF();
$pdf->SetFont('Arial','B',12);
$pdf->AddPage();
$fp = fopen($file_name,"r");
$strContent = fread($fp, filesize($file_name));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output($output_file);

EDIT ANybody who can help me....