Moisès
Moisès

Reputation: 57

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.

Upvotes: 2

Views: 189

Answers (2)

Satoru SATOH
Satoru SATOH

Reputation: 36

Maybe too late but...

I guess that this is because draw:name attributes in ODT outputs (content.xml) generated by rst2odt is set to fixed strings ("graphics2", etc.) and my experimental patch changes this behavior seems to work as far as I tested.

Upvotes: 1

marshall.ward
marshall.ward

Reputation: 7198

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.

Upvotes: 0

Related Questions