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 MAISONNY Benoit <Be...@eurocontrol.int> on 2002/10/03 17:01:07 UTC

display-align on region-*

Hi,

I have a region-after with display-align="after", but the static-content for this region is not vertically-aligned to the bottom.

Is display-align on region-* not implemented or am I doing something wrong with the following FO?

----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<fo:layout-master-set>
		<fo:simple-page-master master-name="content" page-width="21.0cm" page-height="29.7cm">
			<fo:region-body region-name="xsl-region-body" margin="3cm" display-align="center" background-color="#eeeeee"/>
			<fo:region-after region-name="xsl-region-after" extent="3cm" display-align="after"/>
		</fo:simple-page-master>
	</fo:layout-master-set>
	<fo:page-sequence master-reference="content">
		<fo:static-content flow-name="xsl-region-after">
			<fo:block>This text should be vertically aligned to the bottom of the page.</fo:block>
		</fo:static-content>
		<fo:flow flow-name="xsl-region-body">
			<fo:block>This text should be vertically aligned to the center of the grey box.</fo:block>
		</fo:flow>
	</fo:page-sequence>
</fo:root>
----------------------------------------------------------------

(This sample works with XEP.)

I have seen discussions about this attribute on both fop-dev and fop-user, but I can't find a definitive answer for region-* elements. Also, there is no bug report about it in bugzilla (I can create one, if seen useful despite the new design in progress).

Generally proposed workaround is to create a table. It is useful only when one knows the maximum height available, which is the case for the peripheral regions. Here is a working example on region-after for those interested:

----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<fo:layout-master-set>
		<fo:simple-page-master master-name="content" page-width="21.0cm" page-height="29.7cm">
			<fo:region-body region-name="xsl-region-body" margin="3cm" display-align="center" background-color="#eeeeee"/>
			<fo:region-after region-name="xsl-region-after" extent="3cm" display-align="after"/>
		</fo:simple-page-master>
	</fo:layout-master-set>
	<fo:page-sequence master-reference="content">
		<fo:static-content flow-name="xsl-region-after">
			<fo:table table-layout="fixed">
				<fo:table-column column-width="21cm"/>
				<fo:table-body>
					<fo:table-row height="3cm">
						<fo:table-cell display-align="after">
							<fo:block>This text should be vertically aligned to the bottom of the page.</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</fo:table-body>
			</fo:table>
		</fo:static-content>
		<fo:flow flow-name="xsl-region-body">
			<fo:block>This text should be vertically aligned to the center of the grey box.</fo:block>
		</fo:flow>
	</fo:page-sequence>
</fo:root>
----------------------------------------------------------------

I hope this will help others.

Cheers,
Benoit

Re: display-align on region-*

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Harm Kok wrote:
> display-align is not supported by FOP. It is supported by XEP and 
> AntennaHouse and I believe also PassiveTeX supports it.

It works on table cells and under certain circumstances
on block-containers.

J.Pietschmann




Re: display-align on region-*

Posted by Harm Kok <h....@diderottrack.nl>.
Hi,

display-align is not supported by FOP. It is supported by XEP and 
AntennaHouse and I believe also PassiveTeX supports it.

Regards,

Harm

MAISONNY Benoit wrote:

>Hi,
>
>I have a region-after with display-align="after", but the static-content for this region is not vertically-aligned to the bottom.
>
>Is display-align on region-* not implemented or am I doing something wrong with the following FO?
>
>----------------------------------------------------------------
><?xml version="1.0" encoding="UTF-8"?>
><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>	<fo:layout-master-set>
>		<fo:simple-page-master master-name="content" page-width="21.0cm" page-height="29.7cm">
>			<fo:region-body region-name="xsl-region-body" margin="3cm" display-align="center" background-color="#eeeeee"/>
>			<fo:region-after region-name="xsl-region-after" extent="3cm" display-align="after"/>
>		</fo:simple-page-master>
>	</fo:layout-master-set>
>	<fo:page-sequence master-reference="content">
>		<fo:static-content flow-name="xsl-region-after">
>			<fo:block>This text should be vertically aligned to the bottom of the page.</fo:block>
>		</fo:static-content>
>		<fo:flow flow-name="xsl-region-body">
>			<fo:block>This text should be vertically aligned to the center of the grey box.</fo:block>
>		</fo:flow>
>	</fo:page-sequence>
></fo:root>
>----------------------------------------------------------------
>  
>