How to export a shape, which is contained in a frame, to docx?

Miklos Vajna vmiklos at collabora.com
Wed Jan 18 15:55:02 UTC 2023


Hi Regina,

On Sun, Jan 15, 2023 at 01:56:09AM +0100, Regina Henschel <rb.henschel at t-online.de> wrote:
> I ran into the above problem while investigating how to export a Fontwork
> shape to docx.

For the scope of Fontwork -- if you see that Word likes to express
feature set that is close to our fontwork as VML, then exporting that
shape only as VML may make sense. That sidesteps the entire DML/VML
duplicated output that we normally produce.

> So my question is,
> What is the desired behavior for export of a shape, which is inside a frame?
> What gives the best user experience?

It seems to me that in general Writer supports more features here than
Word, so you can't handle all cases. E.g. when I have a textbox in Word
and I insert a shape (anchored) and I try to move its anchor, Word won't
let me move that anchor inside the textbox. The same works fine in
Writer with a textframe and a shape.

Similarly, if I insert an image inside a textbox in Word, then its
anchor type will be "inline" and the UI is disabled to change the
wrapping.

I believe it makes sense to focus on the DML output, since only Word
2007 cares about the VML output; but other than that, ideally we should
try to express the textframe and its content as good as possible using
both markups. That means writing both the textframe/shape and its
content using both DML and VML.

Sometimes this is not possible -- if the result would render the entire
export result unreadable, then it makes sense to do compromises and e.g.
lose the wrap type or the correct anchor position. We do such "delayed"
export of shapes here & there in the docx export code already.

Hope this helps. :-)

Regards,

Miklos


More information about the LibreOffice mailing list