Re: Inline image: valign ignored in HTML output, works in PDF
Hussein Shafie <[email protected]> Fri, 12 Jan 2024 16:34:03 +0100
| Newsgroups | gmane.editors.xxe.general |
|---|---|
| Message-ID | <[email protected]> |
Bård Peter T. wrote:
> it seems that for HTML output, it is not possible to use the
> *valign* on inline images. Here is a small SVG image added to a
> paragraph with inlinemediaobject, the setting valign is set to “middle”
> on the imagedata.
>
> On the left you see the HTML output and on the right is the PDF output.
> PDF output is “correct”, image is in the middle of the line. It doesn’t
> work in HTML, it is always bottom aligned.
That's right. Same behavior with a PNG image.
>
> Is there a way to get valign to work in HTML/Webhelp output?
Sorry but the answer is no.
This is a limitation of the DocBook XSL Stylesheets (these stylesheets
are documented here:
https://docbook.sourceforge.net/release/xsl/current/doc/param.html and
here: http://www.sagehill.net/docbookxsl/index.html).
If you take a look at <xsl:template name="process.image"> found in
XXE_install_dir/addon/config/docbook5/xsl/html/graphics.xsl, you'll find
a long comment explaining this kind of limitation:
---
The HTML img element only supports the notion of content-area
scaling; it doesn't support the distinction between a
content-area and a viewport-area, so we have to make some
compromises.
...
Finally, align and valign are troublesome. Horizontal alignment
is now
supported by wrapping the image in a <div align="{@align}"> (in
block
contexts!). I can't think of anything (practical) to do about
vertical
alignment.
---
We, XMLmind Software, are not the authors of the DocBook XSL Stylesheets
therefore we are not going to improve this. Please do not hesitate to
send a request for enhancement to:
[email protected]
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support