Moisès Moisès - 4 years ago 116
Python Question

rst2odt not showing the third image

I'm trying to convert a rst document with images to odt, but rst2odt seems to fail to get the images from the third one.

It worked a year ago and I guess there must be some upgrade that has changed former behavior.

A simple doc that reproduces my problem is:

######
Report
######

First try

.. image:: image.png

Second try

.. image:: image.png

Last try

.. image:: image.png

The last one is missing in odt!


I process it with:

$ rst2odt test.rst test.odt


And I get an odt with just two images. The third is missing. When using --verbose option, I don't get any complain.

By the way, rst2odt version is (Docutils 0.12 [release], Python 2.7.9, on linux2)

Trying different tips, I've reinstalled python-imaging package and upgraded pillow with no luck

Curiously enough, rst2pdf is able to place the three images properly.

Any help would be highly appreciated since I have a considerable number of rst with a bunch of images, to translate into odt

EDITED: I've purged docutils from my system (Debian Jessie) and then reinstalled without improvement.

Answer Source

I don't think this is necessarily the answer you want, but pandoc seems to do a good job here:

pandoc -f rst -t odt in.rst -o out.odt

I think this is really an outstanding bug in rst2odt, and not the only one (see the python 3 latin-1 to utf-8 encode bug), and it doesn't seem that docutils is as well-maintained as it used to be.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download