I am using TCPDF for generating PDF in magento. Every thing looks fine with HTML as it is generating email quit well as needed, Also it generates PDF. But the issue comes on the second page of the PDF where there is Indentation issue. like:
You can see the table is moving forward one step from second page. Any idea why this is happning.
here is my code:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetAutoPageBreak(true , 5);
$pdf->SetMargins(2 , 5, 2);
$pdf->startPage();
$pdf->setImageScale(1.5);
$emailtext = Mage::helper('request4quote/email')->sendRequestProposalNotification($quote, false, true);
// echo $emailtext;
$pdf->writeHTML($emailtext, true, 0, true, true);
$pdf->endPage();
if ($storeid) {
$appEmulation->stopEnvironmentEmulation($initial);
}
$rfqfilename = 'rfq_' . $quote->getId() . '.pdf';
if(!$saveToDisk) {
return $pdf->Output($rfqfilename);
} else if ($saveToDisk){
$filePath = $this->getFilePath() . $rfqfilename;
$pdf->Output($filePath, 'F');
return $filePath;
}
Any solution guys?