Tutorial :dompdf font family issue



Question:

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?


Solution:1

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>  


Solution:2

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.


Solution:3

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.


Solution:4

Remove the quotes around helvetica.


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