首页 > 其他 > 详细

openerp report image

时间:2014-09-18 20:36:04      阅读:290      评论:0      收藏:0      [点我收藏+]

webkit : 再mako 文件中插入以下代码, <% %>标签用于再mako中定义代码或者函数。 

             然后  ${ embed_image(‘图片类型‘, 图片字段 , 宽度,高度)  } 即可, 本质上是使用html中显示 base64格式的图片标签

       <img $width $heigh src="data:image/$tytpe;base64,$strng_of_base64" />
<%
def embed_image(type, img, width=0, height=0) :
    "Transform a DB image into an embedded HTML image"

    if width :
        width = width="%spx"‘%(width)
    else :
        width = 
    if height :
        height = height="%spx"‘%(height)
    else :
        height = 
    toreturn = <img %s %s src="data:image/%s;base64,%s" />‘%(
        width,
        height,
        type, 
        str(img))
    return toreturn

%>

 

openerp report image

原文:http://www.cnblogs.com/alangwansui/p/3979908.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!