我想用 python 或 php 将多个图像写入 odt 文件

发布于 2024-09-09 04:06:41 字数 317 浏览 1 评论 0原文

我想将多个图像文件写入 odt 文件。我将指定一个目录,脚本将从那里通过循环获取它。但我从哪里开始呢?我以前从来没有做过这样的事!

我找到了这个python代码,它可以将html转换为python...所以我们可以先解析一个html,然后调用这个。但没有关于如何使用它的参考。

html2odt 代码

I want to write multiple image files to a odt file. I will be specifying a dir and the script will take it from there thru a loop. But where do i start? I have never done anything like this before!

I found this python code, which can convert html 2 python... so we can parse an html first and then call this one. But there is no reference on how to use this.

html2odt code

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弄潮 2024-09-16 04:06:41

最后我找到了一种直接编写odt的PHP方法!它有据可查。

http://www.odtphp.com/

我还用php写了一个完整的实用解决方案。您可以上传多个图像并生成 odt 文档。

该代码托管在 http://code.google.com/p/images2odt/
第一篇文章在此处完成。

Atlast I found a PHP way to write odt direct! Its well documented.

http://www.odtphp.com/

I have also written a complete practical solution in php. You can upload multiple images and get the odt document generated.

The code is hosted at http://code.google.com/p/images2odt/
The first post is done here.

潜移默化 2024-09-16 04:06:41

对于任何想要使用 Python 代码的人来说,都需要 Python 解释器版本 2.6。它也可能适用于 2.7 版本。它主要用于Linux,但也有Windows和Mac版本。您还需要 fromimport 语句中列出的文件。这些文件位于其他一些文件夹中。它看起来像是一个更大的 Linux 软件包的一部分。最后一件事,Python 脚本通常从命令行获取参数。

附加信息:
我查看了 setup.py 文件,它告诉我这是一个名为 odfpy 的开放文档 API 库。版本是0.9.2。它的文档链接已损坏。谷歌搜索 odfpy 找到了一个可以在 tarbell 中下载更新版本(0.9.4)的地方:
http://pypi.python.org/pypi/odfpy

可以在此处找到文档打开Office文档:
https://joinup.ec.europa.eu/software/odfpy/document /api-odfpyodt

For anyone wanting to use the Python code will need a Python interpreter version 2.6. It might also work with version 2.7. It's mainly used in Linux but there are Windows and Mac versions as well. You will also need the files listed in the from and import statements. These files are in some of the other folders. It looks like it is a part of a much bigger Linux package. One last thing, Python scripts usually takes their arguments from a command line.

Additional info:
I looked over the setup.py file and it told me that this is an API library for open documents called odfpy. The version is 0.9.2. The link it has for the documentation is broken. A google search for odfpy came up with a place to download a more recent version (0.9.4) in a tarbell here:
http://pypi.python.org/pypi/odfpy

The documentation can be found here in an Open Office document:
https://joinup.ec.europa.eu/software/odfpy/document/api-odfpyodt

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文