Help in alignment in HTML2pdf..
Posted
by piemesons
on Stack Overflow
See other posts from Stack Overflow
or by piemesons
Published on 2010-03-29T09:14:08Z
Indexed on
2010/03/29
12:13 UTC
Read the original article
Hit count: 480
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:-
- Adding margin of 1 inch on all sides of the pdf file.
- I want to start every para with space of two tabs. (" " 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....
© Stack Overflow or respective owner