DOMPDF set font for whole page?

Im using DOMPDF on top of http://dompdf.github.com/

I am trying to set the font for the whole page. In the template I made, I have a font set to Helvetica in CSS, but when it generates a PDF, it defaults to Times New Roman. When i try

<script type="text/php">{literal}if ( isset($pdf) ) { 
    $font = Font_Metrics::get_font("helvetica", "bold");
    $pdf->page_text(72, 18, "TEST!", $font, 6, array(0,0,0));}
{/literal}</script>

He prints a TEST! text in the font. However, how can I apply it to the whole page?

thanks

+5
source share
4 answers

DOMPDF supports CSS, so you can simply define the font in your CSS file and load it as usual on the page:

body {
    font-family: 'Helvetica'
}
+8
source

DOMPDF CSS, :

body {  
    font-family: 'Helvetica'  
}

, , . , , : /dompdf/lib/fonts/

, : http://code.google.com/p/dompdf/wiki/Installation#Font_Installation

+7

. - DomPDF CSS. div, .

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

, , .

+1

CSS:

body, #wrapper, #content {
font-family:sans-serif;
}
table{
font-family:sans-serif;
}     
table tr{
font-family:sans-serif;
}    
table td{
font-family:sans-serif;
}        
a:link, a:visited {
font-family:sans-serif;
}
p {
font-family:sans-serif;
}
0

All Articles