1
我有一个没有样式属性的HTML页面,我正在使用的HTML标签是“中心,换行符标记,粗体标记”.Html页面不包含任何表格。它是一个简单的文件。我需要帮助: -html2pdf无法识别空间并且无法添加保证金
- 在PDF文件的所有边添加1英寸的边距。
- 我想用两个选项卡的空格开始每个段落。 ( “& NBSP” 生成PDF文件,HTML文件中的空间,但不是。)
代码我使用: -
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);