globalmesh Posted March 21, 2013 Share Posted March 21, 2013 Hello, When I add notes with few lines with line breaks, I see <br/> tag in the notes area in PDF created. It just happened after I uprgaded version from 5.1.2 to latest 5.2.2 Usual system PDF, nothing changed, English. Please help 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 21, 2013 Share Posted March 21, 2013 Try using \n for line breaks instead of <br> I tried a quote in an older version of WHMCS and it shows br tags as well. 0 Quote Link to comment Share on other sites More sharing options...
globalmesh Posted March 21, 2013 Author Share Posted March 21, 2013 Thank you, I've used notes in old (5.1.2) version many time, with no problems ever. Now, I've tried using \n and it doesn't help, please see attached screenshots: /https://www.evernote.com/shard/s131/sh/e4b2167a-b502-4538-a4d7-6c81c35425b3/bed0c4cce9d3a2fb57085976ec6bba00 0 Quote Link to comment Share on other sites More sharing options...
fyreflyX Posted March 24, 2013 Share Posted March 24, 2013 Same issue after upgrade to 5.2.2 from 5.1.2 This doesn't happen on quotes, only on invoices. I converted a quote - quote looks good, invoice full of <br /> tags in the notes. Also tried the Portal and Default templates - same issue 0 Quote Link to comment Share on other sites More sharing options...
And then there was one les Posted March 25, 2013 Share Posted March 25, 2013 It is highly likely that you no longer need to use a html line break. IF this is in a text area (right click and view source of the input form) then pressing enter automatically uses a \n. You will notice this if you are adding api ip addresses it tells you to enter them 1 per line, that is because they are using the standard function of a text area to allow for ip address separation in the table. This means anything pulled from a text area will have the lined already used. i have no reason to think that if its done there it will also be done else where, it takes less code to handle a \n than it does a <br>, also note. the use of <br /> is for XHTML where the requirement is to close all opened tags and instead you should be using <br> in your HTML templates. While browsers cope with it, if you intend on validating your code you will find you need to replace each of them. 0 Quote Link to comment Share on other sites More sharing options...
fyreflyX Posted March 25, 2013 Share Posted March 25, 2013 Thank you, but there is no markup in the notes area. This is just the notes tab on an invoice, new lines are just made by clicking enter. I first noticed it when I went to send a pdf copy of an invoice that was converted from a quote. The line items are fine (item & cost), its only under the total in the notes area where the <br /> tag is coming up at the end of each line. Attached a screenshot 0 Quote Link to comment Share on other sites More sharing options...
omnigenus Posted March 27, 2013 Share Posted March 27, 2013 Just use HTML in your PDF. Use something like this: if ($notes) { $notes = '<table width="100%" height:"30"><tr> <td style="font-weight:bold;text-align:left;" width="15%">'.$_LANG["invoicesnotes"].':</td> <td style="font-weight:normal;text-align:left;" width="85%">'.$notes.'</td> </tr></table>'; $pdf->writeHTML($notes, true, false, false, false, ''); } insted of something like this: if ($notes) { $pdf->SetFont('helvetica','',; $pdf->MultiCell(170,5,$_LANG["invoicesnotes"].": $notes"); } 0 Quote Link to comment Share on other sites More sharing options...
fyreflyX Posted March 27, 2013 Share Posted March 27, 2013 That worked, thank you Omnigenus. 0 Quote Link to comment Share on other sites More sharing options...
omnigenus Posted March 27, 2013 Share Posted March 27, 2013 No problem 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.