Possible to use base64 embeded images?

1,331 views
Skip to first unread message

armanx

unread,
Apr 24, 2013, 10:07:49 PM4/24/13
to wkhtmltop...@googlegroups.com
I'm trying to use this:

%img{:src => "data:image/png;charset=utf-8;base64,AATL..."}

but either getting a broken image icon, or no image at all. Since WebKit supports data URIs, doesn't wkhtmltopdf support them too? If so, why doesn't it work?

armanx

unread,
Apr 24, 2013, 10:10:35 PM4/24/13
to wkhtmltop...@googlegroups.com
For those who don't read HAML, I meant this:

<img src="data:image/png;charset=utf-8;base64,AATL..">

Kees van Spelde

unread,
Apr 29, 2013, 4:22:15 AM4/29/13
to wkhtmltop...@googlegroups.com
You have to replace the tags with a path to the file. A base64 block is a EML thing. Not an HTML thing.

Yozons eSignForms

unread,
Apr 29, 2013, 2:12:43 PM4/29/13
to wkhtmltop...@googlegroups.com
I've not used data URIs before, but it does seem to have limited mention in the HTML 4 specs for OBJECT tags:

http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#h-13.3.1

And wikipedia suggests data URIs have been implemented in most browsers, including WebKit-based ones:

https://en.wikipedia.org/wiki/Data_URI_scheme

Donavon Lerman

unread,
May 9, 2014, 1:55:11 PM5/9/14
to wkhtmltop...@googlegroups.com
Don't know if this is still relevant.

I was able to get base64 images to work.

<img id="image" src="data:image/gif;base64,R0lGODlhFwAPAKEAAP///wAAAMzMzLi3tywAAAAAFwAPAAACQIyPqQjtD98RIVpJ66g3hgEYDdVhjThyXSA4aLq2rgp78hxlyY0/ICAIBhu/HrEEKIZUyk4R1Sz9RFEkaIHNFgAAOw==" />
Reply all
Reply to author
Forward
0 new messages