Loading network or remote https images
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?
Can you try running Prince from the command-line first and see if you encounter similar issues?
I don’t think I can as the html is generated dynamically in PHP
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.
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
Hi Mike - any pointers for getting either of these methods to work? Seems to work with the command line but not in PHP
Would you be able to email me (firstname.lastname@example.org) the log showing the errors?
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)
warning: Could not resolve host: xxxxx.co.uk
E://images/FF52B545-9356-4D3C-9795-D45F1026A108.jpg: warning: can't open input file: No such file or directory
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