Forum How do I...?

Loading network or remote https images

oamobile
I’m using the PHP wrapper and am producing a PDF with the pass through string method.

I ideally want to include some images stored on a network share but have been unable to get it to work. Logs state no such file or directory.

I have then tried to use a external url to pull the images but still I can’t get it to work. Logs state cannot resolve host.

Is there a switch of some sort that is preventing loading the images? It works fine as html viewed in the browser?

Many thanks
mikeday
Can you try running Prince from the command-line first and see if you encounter similar issues?
oamobile
I don’t think I can as the html is generated dynamically in PHP
mikeday
Perhaps access the page with the browser and save the HTML it generates? At the very least it helps to see exactly what is ending up in the input document.

Are the image paths absolute? If they are relative then you will need to make sure that the document has a valid base URL to resolve them against.
oamobile
Hi - urls are absolute (they are referring to an external website). It works when I use the command line. When through PHP though it just shows the href alt description.

I would actually prefer to use a mapped network drive rather than pulling them across the internet. I’ve tried mapping the drive in PHP and also in Windows but neither seem to work. If this isn’t possible then pulling from the internet is the fallback option
oamobile
Hi Mike - any pointers for getting either of these methods to work? Seems to work with the command line but not in PHP
mikeday
Would you be able to email me (mikeday@yeslogic.com) the log showing the errors?
oamobile
Hi Mike, the logs show nothing but these two lines depending if I try the network path or https url... (i've removed the domain for security - have confirmed the url is valid and opens in a browser)

URL:
https://xxxxx.co.uk/images/012E486C-DA2C-47BE-91BA-2B9B53238D3E.jpg: warning: Could not resolve host: xxxxx.co.uk

Network:
E://images/FF52B545-9356-4D3C-9795-D45F1026A108.jpg: warning: can't open input file: No such file or directory
oamobile
I've just tried a different web server with a different domain, checked the url definitely is valid and still says it can't resolve the host xxxxx.com