0

I would like to generate a PDF file by using Html2PDF. My HTML code contains an image which generates an ImageException : Unable to get the size of the image.

Here is my HTML code :

<page>
        <table>
            <tr>
                <td style="background-image: url('http://localhost:8000/uploads/societes/logos/5b23cfc3065f5716588985.jpg')"></td>
            </tr>
        </table>
</page>

The path of the image is correct as I can load it into my navigator by using the url.

What am I doing wrong?

ThBM
  • 71
  • 5
  • When you run the script you have the html2pdf action... is that also being run from `http://localhost:8000/` ? If its being run from a remote server, it will not find the image on your localhost. – IncredibleHat Jun 15 '18 at 16:06
  • 1
    [maybe related](https://stackoverflow.com/questions/27060947/tcpdf-error-unable-to-get-the-size-of-the-image) - perhaps you can try using a relative url instead for your image – James Jun 15 '18 at 16:06
  • Thank you for replies. I also run from localhost:8000. It is the same server. I tried relative path too, but nothing changed. – ThBM Jun 15 '18 at 16:13

0 Answers0