Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top