IMG SRC not working. Image visible in HTML but not in PDF

3,315 views
Skip to first unread message

Laurent Debacker

unread,
Sep 16, 2015, 10:13:21 AM9/16/15
to wkhtmltopdf General
I'm dynamically building a HTML file. Images src are added depending on the user input. 
whatever source I use nothing shows up.

src="D:/Work/NPGC/companies/image.png"
src="file:///D:/Work/NPGC/companies/image.png"
src="/../../companies/image.png" (-> This is what I want to use)

using the above paths in an html file works fine but wkhtmltopdf does not display anything in the subsequent PDF. 

Let me know if more information is needed. I've searched around but haven't found a simple answer that works for me.


Krystian Bigaj

unread,
Feb 17, 2016, 12:23:01 AM2/17/16
to wkhtmltopdf General
On Wednesday, 16 September 2015 16:13:21 UTC+2, Laurent Debacker wrote:
src="D:/Work/NPGC/companies/image.png"
src="file:///D:/Work/NPGC/companies/image.png"
src="/../../companies/image.png" (-> This is what I want to use)
I looks like when path starts with "/", then it means "root directory of a drive where html file is".
So for "/dir1/dir1/image.png", it looks for a file at "C:\dir1\dir2\image.png".
If you skip "/" if front of the path, then it will use relative path of a html file, like "../../companies/image.png"

Michael Sieber

unread,
Mar 17, 2016, 5:26:27 AM3/17/16
to wkhtmltopdf General
I have a similar problem.  The path to the image ist a network-path, the html src looks like this
src="file:///\\PC-MSI02\EuroSDS_shared\custom\pictures\trays\ACH-100\ACH-100.jpg"
this works fine for IE and FF, but after a conversion to pdf the images are gone.
How it's supposed to look like for wkhtmltopdf to work (and html IE/FF at the same time)?

Thank you.

Steve Waite

unread,
Aug 31, 2016, 4:24:53 AM8/31/16
to wkhtmltopdf General
I'm having exactly this problem also.

For me, I had  to use the alpha version to get file:/// links working, but they will only work for drive mappings, not UNC paths.

I also really need UNC path mappings, is there any solution?  Do any older versions support this?

Qasim Lodhi

unread,
Sep 7, 2016, 12:29:52 PM9/7/16
to wkhtmltopdf General
Try absolute position for the image and see if that shows up in the PDF. There was a thread about it somewhere...
Reply all
Reply to author
Forward
0 new messages