Odoo Help

Welcome!

This community 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.

1

Images in webkit / mako pdf reports

By
Antanas
on 5/15/13, 7:56 AM 3,648 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

--Daniel Reis--
3436
| 6 7 9
Lisbon, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


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}"/>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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