Images on a table cell

Asked by Sergio Vera on 2014-06-30

Hello

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
from
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?

Regards

Question information

Language:
English Edit question
Status:
Answered
For:
Appy Edit question
Assignee:
No assignee Edit question
Last query:
2014-07-01
Last reply:
2014-07-01

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,
Gaëtan

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
from
document(at='snapshot0.png')

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:

<table:table-row>
 <text:p>
  <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"/>
  </draw:frame>
 </text:p>
 <table:table-cell office:value-type="string" table:style-name="Tabla1.B1">
  <text:p text:style-name="P15">
  </text:p>
 </table:table-cell>
</table:table-row>

Hand generated Cell:

<table:table-row>
 <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"/>
   </draw:frame>
  </text:p>
 </table:table-cell>
 <table:table-cell table:style-name="Tabla1.B1" office:value-type="string">
  <text:p text:style-name="P15"/>
 </table:table-cell>
</table:table-row>

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.
Cheers
Gaetan

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.