sandrods / odf-report

Generates ODF files, given a template (.odt) and data, replacing tags

Home Page:http://sandrods.github.com/odf-report

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error image

capimoreras opened this issue · comments

I get errors when using images with ODF REPORT. I used libreoffice, and the steps I follow are:

  1. Insert any image into the template and put I put the "graphic" name.

Then in my code I have ODF-REPORT:

  1. r.add_image ("graphic", File.join (Dir.pwd, 'grafico.png'))

And when I generate the document, I get an error reading the image.

If you could be a little more specific about the error...

Hi Sandro,

If I insert the linked picture in the template, it does not generate the report and throws me an error "Errno :: ENOENT: No such file or directory", tells me that there is the Pictures folder.

If I insert an image without link, the report is generated but the image appears with a message "Error reading image."

Thanks for your gem is helping me a lot.

It looks like you neither have file at that location nor you use absolute path. I use this code:

r.add_image :logo, Rails.root.join('app/templates', "logo.png")

It works perfect in linux (Ubuntu 12.04 with LibreOffice) but in my previous Windows Vista with LibreOffice or Openoffice system gave me the errors described above.

Many Thanks for your advice.

Hi,
I have the same problem too...
On MacOS or Raspberry, the images can be seen very well, but on windows, the images do not appear, and the odf file gives me error "Error reading image"

Thank you.