You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Biying Huang <bi...@synthematix.com> on 2002/10/22 20:06:53 UTC

How to align images horizontally on a middle line?

Hi, all:

I have a list of images who's size are various ( for example: big.jpg is
140 x 104, mid.jpg is 100 x 60, and small.jpg is 45 x 45 ). How can I
horizontally align these images so that their middle lines are on the
same line?

The following code does not work because "alignment-baseline" is not
implemented yet.

<fo:block>
    <fo:external-graphic alignment-baseline="middle" src="big.jpg"/>
    <fo:external-graphic alignment-baseline="middle" src="mid.jpg"/>
    <fo:external-graphic alignment-baseline="middle" src="small.jpg"/>
</fo:block>

I appreciate any suggestions. Thanks.

Biying Huang


Re: How to align images horizontally on a middle line?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Biying Huang wrote:
> I have a list of images who's size are various ( for example: big.jpg is
> 140 x 104, mid.jpg is 100 x 60, and small.jpg is 45 x 45 ). How can I
> horizontally align these images so that their middle lines are on the
> same line?

In general, you can't, because vertical align and line height recalculation
are not implemented. If you the lines in advance, you can put the content
in a table and use display-align="center" on the cells containing text.
For certain image sizes using vertical-align="sub" on the text surrounding
the image might be another approximation.

J.Pietschmann