Tutorial :dompdf font family issue


I'm using Bamboo invoice as an invoice generator, and I'm trying to customize the invoice template, but no matter what I do, the font just won't seem to adjust.

currently I have

body {  margin: 0.5in;  font-family: 'helvetica';  font-size: 10pt;}  

I've read up on it, and helvetica is an installed font, so it should work

to make sure I changed it to 'courier'; which is also in the lib/fonts directory, but the font remains the same.

Any help?


Kinda late, but still applicable for google visitors

I had a similar problem with DomPDF, but since BambooInvoice uses it... Anyway DomPDF has trouble with the font-family definition in the CSS. I applied inline style to the top div box to solve the problem.

<div id="container" style="font-family:sans-serif;">  ....  </div>  


I solved my problem by removing a font: inherit that was applied as a 'css-reset' to almost all elements as a first declariation. Apparently this is not overridden by later declarations, and/or inherit doesn't work properly.


I had similar problem with DomPDF 6b3 when trying to use font-family or font-size. Finally discovered that using font instead of those seems to be working.


Remove the quotes around helvetica.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »