Welcome Guest, Not a member yet? Register   Sign In
domPDF Images

I'm having this strange problem. When generating the pdf locally the images are displayed in the pdf file, but when I upload it to the public server I only get the html printed on the pdf and not the image. Yes I've checked the image path and everything.

I have searched the forum for similar problems, and there seem to have been some, but those solutions aren't working for me.

Any suggestions?

the view (head only including the image)
        <style type="text/css">
                font-size: 10px;
                border: 1px solid;
                border-color: #aaa;
            table th{
                border: 1px solid;
                border-color: #aaa;
            table td{
                border: 1px solid;
                border-color: #aaa;
                margin-left: 25px;
                margin-top: 10px;
                margin-bottom: 20px;
                height: 50px;
        <img src="&lt;?php echo base_url() . 'assets/img/ba-logo-web.jpg'; ?&gt;" id="img" />

the function
                $this->template->write_view('content', 'details_pdf', $data);    
                $html = $this->template->render('content');
                pdf_create($html, 'filename');

did you ever figure this out?

the problem I'm having with images is that in the PDF, the image is just a red X. When I write the html out to the page, the image shows fine though, just not in the pdf.

I found out that it was servers fault

The SOLUTION for including images in domPDF.

It doesn't matter that the images display in your browser.

You must include the server path to the image.

In my case it was this (img resides in the same folder as my system folder):

<img src="./img/pdf/logo.png">

[quote author="emorling" date="1284432529"]You must include the server path to the image.[/quote]
well, my system folder is outside the web root. so I would need the full server path to the image then and not the full URL?

Theme © iAndrew 2016 - Forum software by © MyBB