John Marlon
John Marlon

Reputation: 61

laravel dompdf - issue with font

I need extended support for latin based font, so I wanted to use default font "dejavu sans", but the text is completely white and it's ignoring css rules. Any ideas?

Thanks.

I'm using laravel 4 Here's the code:

php

$pdf = PDF::loadView("project.accounting.pdf_offer", $data);
        $pdf->output();
        $dom_pdf = $pdf->getDomPDF();
        $canvas = $dom_pdf->get_canvas();
        $canvas->page_text(35, 803, sprintf("%s {PAGE_NUM} %s {PAGE_COUNT}", Lang::get("default.page"), Lang::get("default.from")), null, 7, array(0, 0, 0));

        return $pdf->stream();

css

html, body {
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 12px;
font-family: inherit;
vertical-align: baseline;
line-height: 1;
color: #111;
background: white;
font-family: "dejavu sans", serif;

}

Upvotes: 2

Views: 3427

Answers (1)

John Marlon
John Marlon

Reputation: 61

Found solution to the problem - at first I was generating page number from controller, but then I moved it to template (inline) as script/php, and now it's fine.

Thanks for helping me.

Upvotes: 1

Related Questions