views:

600

answers:

1

Hi

Im using DOMPDF over at http://www.digitaljunkies.ca/dompdf/

I am struggling how to set the font for the entire page. In the template I have made I have the font set to Helvetica in the CSS but when it generates the 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>

It prints the TEST! text in the font. However how do I get it to apply to the whole page?

Thanks

A: 

DOMPDF supports CSS, so you can just define the font in your CSS file and load it like you normally would on a page:

body {
    font-family: 'Helvetica'
}
Tatu Ulmanen