zazups Posted November 27, 2013 Share Posted November 27, 2013 Hi there guys, I want to modify a little bit, my pdf invoice by adding two paragraphs of html text in the footer of my pdf invoice, just before the generation date. How can i do that without using Custom Pdf Invoice addon. I'm waiting for your respone. Thx in advance! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 27, 2013 Share Posted November 27, 2013 $pdf->SetFont('freesans','',7); $termshtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef"> <td width="100%">Insert your text here</td> </tr></table>'; $pdf->writeHTML($termshtml, true, false, false, false, ''); $pdf->Ln(5); # Generation Date $pdf->SetFont('freesans','',; $pdf->Ln(5); $pdf->Cell(180,4,$_LANG['invoicepdfgenerated'].' '.getTodaysDate(1),'','','C'); top line sets the font size, so if it's too small increase the number... table may have a grey background, if not wanted just remove the bgcolor bits. 0 Quote Link to comment Share on other sites More sharing options...
zazups Posted November 28, 2013 Author Share Posted November 28, 2013 Ok. thx man. it worked. Now i want this custom html text to apper when the invoice status in UNPAID and another custom html text when the invoice status in PAID. In my invoicepdf.tpl file i've added this code but in front of generation date code it seems to be not working: if ($status!="Paid") { $pdf->SetFont('freesans','',7); $termshtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef"> <td width="100%">Insert your text here</td> </tr></table>'; $pdf->writeHTML($termshtml, true, false, false, false, ''); $pdf->Ln(5); } What is the problem? I've done something worng? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 28, 2013 Share Posted November 28, 2013 it probably just needs "==" instead of "=".... we use a similar technique on our pdf invoices where the due date is in red on the unpaid invoice and black when its paid. if ($status=="Paid") { $termshtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef"> <td width="100%">Insert your PAID text here</td> </tr></table>'; } else { $termshtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef"> <td width="100%">Insert your UNPAID text here</td> </tr></table>'; } $pdf->writeHTML($invhtml, true, false, false, false, ''); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.