raykolbe / DOMPDFModule

A Zend Framework module for Dompdf
MIT License
61 stars 62 forks source link

Can't include project images or css #54

Open matiasiglesias opened 7 years ago

matiasiglesias commented 7 years ago

I ca't find the way to include site images and css in my pdf

On my controller:

$pdf = new PdfModel();

$pdf->setOption('filename', 'myfile.pdf');
$pdf->setOption('terminal',true);
$pdf->setOption('paperSize', 'a4');

$pdf->setTemplate('my/model/view.phtml');

$pdf->setVariables(array(
    'foo' => $bar,
));
return $pdf;

On my View:

<head>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/font-awesome.min.css">
</head>
<body>
   <div class="hero">
      <h3>My pdf file</h3>
      <img src="/img/logo.png" alt="My Logo">
   </div>
</body>

but no image or any css style is displayed.... What I am doing wrong? Please give me a hint. Thanks!