Odoo Help

1

Images in webkit / mako pdf reports

By
Antanas
on 5/15/13, 7:56 AM 4,443 views

How can one have images in webkit/mako reports? I have some trouble in getting them into reports, f.e. having this in .mako file does not work:

<div class="main_right">
    <img src="img/logo.png" alt=""/>
</div>

Image path is correct.

3
Daniel Reis
On 5/15/13, 8:13 AM

You can embed the image in the template text file using base64:

<img src="data:image/png;base64,[...base64 here...]" />

For example:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />

There are online services available that can convert your images to base64, like Web Coder Tools or base64-image.

Thank you! That solves the problem perfectly.

Antanas
on 5/15/13, 10:05 AM
3
alfonso olavarria
On 5/20/13, 3:54 PM

embed this in your code mako. must clearly define the logo image settings - webkitlogos.

$ {helper.embed_logo_by_name ('cvg', width = 90)}

0
Yogesh
On 9/30/16, 8:14 PM

try like
<img width="250" src="data:image/png;base64,${object.image}"/>

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 5/15/13, 7:56 AM
Seen: 4443 times
Last updated: 9/30/16, 8:14 PM