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 David Neary <Da...@phenix.fr> on 2003/04/24 18:02:12 UTC
block-containers and absolute positioning
Hi,
I have a feeling this is probably very easy, but I have had
some trouble doing it. I'm pretty hopeful that one of ye can
point out the obvious mistake I'm making :)
I'm using fop 0.20.4 on Win32. I would like to lay out a
letterhead type thing which looks something like this...
+--------+
| | Name
| | Address 1
| Logo | Address 2
| | Phone
| | Fax
+--------+
I think that this should be a block container with two blocks
in it - one containing the external-graphic and one
containing the rest of the letterhead (I guess I could do it
with a table too). Then the right-hand block would contain
one block each for each of the different data items in the letterhead.
So what I ended up with is
<fo:static-content flow-name="xsl-region-before">
<fo:block-container font-size="20pt" text-align-last="center">
<fo:block left="0pt" top="0pt" width="20mm" height="20mm"
position="absolute">
<fo:external-graphic width="20mm" height="20mm"
src="url(http://www.linux.ie/images/tux.gif)"/>
</fo:block>
<fo:block left="20mm" top="0pt" width="180mm"
height="20mm" position="absolute">
<fo:block>Tom Jones</fo:block>
<fo:block>17 Rugby Street</fo:block>
<fo:block>Cardiff CA12 14GC</fo:block>
</fo:block>
</fo:block-container>
</fo:static-content>
The only problem is it doesn't work :) Either I put the two
blocks in a block, and I get classic block behaviour (logo
first, then text beneath) or I put them in a block-container,
and noting gets displayed.
For information, in the page-master, the extent of the before
is set to 4cm (for testing purposes).
Can anyone help me lay out the header?
Cheers, and thanks for the help,
Dave.
--
David Neary
Phenix Engineering
110 ave Jean Jaures, 69007 Lyon
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: block-containers and absolute positioning
Posted by "J.Pietschmann" <j3...@yahoo.de>.
David Neary wrote:
> I'm using fop 0.20.4 on Win32. I would like to lay out a
> letterhead type thing which looks something like this...
>
> +--------+
> | | Name
> | | Address 1
> | Logo | Address 2
> | | Phone
> | | Fax
> +--------+
>
>
> I think that this should be a block container with two blocks
> in it - one containing the external-graphic and one
> containing the rest of the letterhead (I guess I could do it
> with a table too).
A table would indeed be the more recommended solution.
> <fo:block-container font-size="20pt" text-align-last="center">
> <fo:block left="0pt" top="0pt" width="20mm" height="20mm"
> position="absolute">
Specifying position on fo:block has no effect in FOP, it only works on
fo:block-container. You have to use two containers:
<fo:static-content flow-name="xsl-region-before">
<fo:block-container left="0pt" top="0pt" width="20mm" height="20mm"
position="absolute" font-size="20pt" text-align-last="center">
<fo:external-graphic width="20mm" height="20mm"
src="url(http://www.linux.ie/images/tux.gif)"/>
</fo:block-container>
<fo:block-container left="20mm" top="0pt" width="180mm" height="20mm"
position="absolute" font-size="20pt" text-align-last="center">
<fo:block>Tom Jones</fo:block>
<fo:block>17 Rugby Street</fo:block>
<fo:block>Cardiff CA12 14GC</fo:block>
</fo:block-container>
</fo:static-content>
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org