Closed GregorySokoloff closed 4 years ago
Don't know if this answers your question, but in LO, you can use: Insert > Image and select your image instead of creating a comment with a background.
In FastODS, that is possible to implement. An image can already be added to the archive as in: https://github.com/jferard/fastods/blob/master/fastods-examples/src/main/java/com/github/jferard/fastods/examples, but we need to add some tags to FastODS.
First, we need a new style of family graphic
, and a style:graphic-properties
tag representation, to describe the container. Example:
<style:style style:name="gr1" style:family="graphic"><style:graphic-properties
draw:stroke="none"
draw:fill="none"
draw:textarea-horizontal-align="center"
draw:textarea-vertical-align="middle"
draw:color-mode="standard"
draw:luminance="0%"
draw:contrast="0%"
draw:gamma="100%"
draw:red="0%"
draw:green="0%"
draw:blue="0%"
fo:clip="rect(0mm, 0mm, 0mm, 0mm)"
draw:image-opacity="100%"
style:mirror="none"/></style:style>
Second, we need a table:shapes
tag for the image itself:
<table:shapes>
<draw:frame draw:z-index="2" draw:name="Image 1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="246.42mm" svg:height="98mm" svg:x="45.15mm" svg:y="70.67mm">
<draw:image xlink:href="Pictures/y.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"><text:p/></draw:image>
</draw:frame>
</table:shapes>
We need also a draw:fill-image
tag in styles.xml > office:styles
(reference given by the attribute draw:fill-image-name
):
<draw:fill-image draw:name="DN" xlink:href="Pictures/x.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
The table:shapes
tag would help for #159.
More on comment background:
<office:annotation draw:style-name="gr1" ...>
<office:automatic-styles><style:style style:name="gr1" style:family="graphic"><style:graphic-properties draw:fill-image-name="DSCF2917" .../></style:style>
<office:styles>...<draw:fill-image draw:name="DSCF2917" xlink:href="Pictures/.....jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></office:styles>
@jferard Hi Julien, I'm back finally to try embedding an image (but not a background image to a tooltip!). A few thoughts:
Hi @GregorySokoloff. Short answer, the long one will come soon:
SVGRectangle.cm(0, 0, 15, 10)
).(Not so) long answer:
1,2,3. I hope the short answer is enough.
TableCell
interface, but you can't insert an instance in the table. I will think about it, and look if there is no impediment.Opened #181 for 4.
The only way I know to insert an image in a document is to create a comment for a cell and then add a background image to the comment. I'm not an expert and will be happy to hear of other alternatives.