Images on a table cell

Asked by Sergio Vera on 2014-06-30


I'm trying to add images to my table cells, but somewhat i'm inable to do so.
So far the best I have managed to obtain is a empty table cell.

The template has the comment:
do cell
document(at='snapshot0.png', anchor='as-char')

The result is a table with the cell where the image was supposed to be completely mising.

Any hints?


Question information

English Edit question
Appy Edit question
No assignee Edit question
Last query:
Last reply:

Hi Sergio,
The test would be to create a standard Calc file with a cell containing an image (I suppose it is a Calc feature if you try to do it, personally I've never tried that), to unzip it and to compare, in the included context.xml, the XML code produced by pod and the one produced by LibreOffice (the standard file). So we will get a feeling of what is wrong with what pod does.
Would it be possible for you to do this test?
Thanks in advance,

Sergio Vera (sergio-vera-h) said : #2

Hi Gaëtan

Sorry for the lack of necessary context. The problem is with a Libreoffice odt document (a table inside a odt).
I will do this test with the odt document and have a look at the generated context.xml.

Best regards!

Sergio Vera (sergio-vera-h) said : #3

Hello Again.

I've been able to do the proper tesing.

I've created a Libreoffice Writer template with a section, a small text, and a single 2 cols, 1 row table. On the left cell of the table i've added the following pod command using a comment:

do cell

I've also inserted the same image by hand in a similar document.
After running pod, the contents.xml of each result is this one:

POD Generated Cell:

  <draw:frame draw:name="03a6772771d243769f4ac5377fd8c4bc" draw:z-index="0" text:anchor-type="as-char" svg:width="13.582800cm" svg:height="11.115258cm">
   <draw:image xlink:type="simple" xlink:show="embed" xlink:href="Pictures/77b01c61cc3843089ca81871417a8738.png" xlink:actuate="onLoad"/>
 <table:table-cell office:value-type="string" table:style-name="Tabla1.B1">
  <text:p text:style-name="P15">

Hand generated Cell:

 <table:table-cell table:style-name="Tabla1.A1" office:value-type="string">
  <text:p text:style-name="P15">
   <draw:frame draw:style-name="fr1" draw:name="Imagen1" text:anchor-type="paragraph" svg:width="8.599cm" svg:height="7.036cm" draw:z-index="0">
    <draw:image xlink:href="Pictures/1000020100000258000001EB0C20B176.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
 <table:table-cell table:style-name="Tabla1.B1" office:value-type="string">
  <text:p text:style-name="P15"/>

As you can see, pod inserts the image but it seems that it does not inserts the proper table:table-cell element surrounding the image so the resulting document is missing one cell (with the image).

I can provide screenshots and additional files if necessary.

Hi Sergio,

OK I see! I thought you were using a Calc template, sorry.
Indeed, LibreOffice always requires images and texts to be within paragraphs within a table cell.
So simply write:

do text
from document(at='snapshot0.png')

instead of

do cell
from document(at='snapshot0.png')

Indeed, when you are in a cell, you also are in a paragraph because LibreOffice always creates a paragraph to store the cell content.

Can you help with this problem?

Provide an answer of your own, or ask Sergio Vera for more information if necessary.

To post a message you must log in.