使用django-webodt的变量图像 [英] Using variable images with django-webodt

查看:141
本文介绍了使用django-webodt的变量图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人使用 django-webodt 吗?查看文档,我找不到关于在文档中使用图像的任何内容。我想在我的ODT文档中插入变量图像(ImageField)。这是可能的吗?



我正在使用OpenOffice后端。

解决方案

p>我不知道这是否是您的解决方案,我在我的项目中使用 pod 很好的结果,我从来没有测试过包含图像,但是记录在案:



引用pod doc




将外部文件或图像集成到结果中:文档功能 p>

文档功能允许您将来自外部来源的
图像或文件集成到ODT结果中。这里是函数
签名;下表解释了每个参数。


EDITED DUE OP COMMENT



我来测试它,工作得很好,也是循环。在这里,您可以看到具有图像的python(或django)渲染文档:

 >>>从appy.pod.renderer导入Renderer 
>>> taula1 = [1,2,3]
>>>> taula = [taula1,taula1]
>>> renderer = Renderer('report.odt',globals(),'result.odt')
>>> renderer.run()

ODT:





结果: p>


Is anyone using django-webodt? Looking through the documentation, I can't find anything about using images in a document. I want to insert "variable" images (ImageField) in my ODT document. Is this possible?

I'm using the OpenOffice backend.

解决方案

I don't know if it is a solution for you, I use pod in my projects with nice results, I have never tested to include images but it is documented:

Quoting pod doc:

Integrating external files or images into the result: the document function

The document function allows you to integrate, into the ODT result, images or files that come from external sources. Here is the function signature; the table below explains each parameter.

EDITED DUE OP COMMENT

I come to test it and work pretty well, also into loops. Here you can see python (or django) rendering document with images:

>>> from appy.pod.renderer import Renderer
>>> taula1 = [1,2,3]
>>> taula = [ taula1, taula1 ]
>>> renderer = Renderer('report.odt',  globals(), 'result.odt')
>>> renderer.run()

ODT:

Result:

这篇关于使用django-webodt的变量图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆