Dompdf remote image is not displaying in pdf

后端 未结 17 2271
臣服心动
臣服心动 2020-12-09 17:28

On my server pdf generated via dompdf was not displaying images. Because they are remote url images.(local images are working fine) then I come to know that it needs some se

17条回答
  •  无人及你
    2020-12-09 18:00

    Can you reach those URLs in your web browser on the machine that you're using to open the PDF? If not, the PDF reader won't be able to either.

    I suspect that the "localhost" domain means that those URLs are only visible from the web server that generated the PDF. You need to output a url like http://example.com/dompdf/image.jpg

    (To step around this issue, bear in mind that there are good reasons not to use remote images. The document will look bad if the viewer is not connected to the internet, for example. Is it possible to just embed the images directly in the document?)

提交回复
热议问题