Discussion:
position block-container relative to right and bottom
Mark Williams
2004-02-18 12:02:53 UTC
Permalink
Hi,

I've posted a couple of messages on the xsl list and got responses re above
problem. It seems like there may be a bug in FOP re positioning relative to
right and bottom edge's of the container.

The spec says that right and bottom positioning are implemented. However,
when I do the following:

<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" left="0cm" top="0cm" right="0cm"
bottom="0cm" background-color="rgb(192, 192, 192)" border-color="rgb(0, 0,
0)" border-style="solid" border-width="1pt">
<fo:block>&#160; </fo:block>
</fo:block-container>

I would expect this to produce a grey-shaded page with a 1pt black border at
the margin edges of each page in the flow. Instead I get a miniscule box
(about 2mm sq) at the top left margins of the page.

If, however, I do the following, I get roughly what I want.

<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" left="0cm" top="0cm" width="19cm"
height="27cm" background-color="rgb(192, 192, 192)" border-color="rgb(0, 0,
0)" border-style="solid" border-width="1pt">
<fo:block>&#160; </fo:block>
</fo:block-container>

Can anyone tell me if I am doing something wrong or whether this is a known
FOP problem and, if so, any workarounds please.

TIA for any help.

Regards,

Mark Williams
Chris Bowditch
2004-02-18 15:21:38 UTC
Permalink
Post by Mark Williams
Hi,
I've posted a couple of messages on the xsl list and got responses re above
problem. It seems like there may be a bug in FOP re positioning relative to
right and bottom edge's of the container.
I'm not sure what you mean by this. Do you mean you want to specify the
position for the block container relative to the bottom right corner of
the page? Normally its specified relative to the top left.

Or perhaps you mean for the contents to be vertically aligned to the
bottom, then specify display-align="bottom", and horizontally aligned to
the right, text-align="right"

<snip/>
Post by Mark Williams
I would expect this to produce a grey-shaded page with a 1pt black border at
the margin edges of each page in the flow. Instead I get a miniscule box
(about 2mm sq) at the top left margins of the page.
Its true that FOP doesnt fully implement block-containers, and FOP's
implementation expects width and height to be specified
Post by Mark Williams
If, however, I do the following, I get roughly what I want.
<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" left="0cm" top="0cm" width="19cm"
height="27cm" background-color="rgb(192, 192, 192)" border-color="rgb(0, 0,
0)" border-style="solid" border-width="1pt">
<fo:block>&#160; </fo:block>
</fo:block-container>
Can anyone tell me if I am doing something wrong or whether this is a known
FOP problem and, if so, any workarounds please.
Fop currently only supports block-containers that are absolutely
positioned, and you need to specify top/left coordinates relative to the
top/left corner of the page, and width and height must also be present.

Chris
Mark Williams
2004-02-18 15:43:27 UTC
Permalink
Hi Chris,

Thanks for the reply and apologies for not making myself clear.

What I am trying to do is within the region-body flow have a
background-color enclosed with a single point border, with the coordinates
of that box being specified relative to the margins of the page. For
example if the margins are 3cms all around and the page is 21 cms wide and
29 cms high then the following would do precisely what I want:

<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" left="0cm" top="0cm" width="15cm"
height="23cm" background-color="rgb(192, 192, 192)" border-color="rgb(0, 0,
0)" border-style="solid" border-width="1pt">
<fo:block>&#160; </fo:block>
</fo:block-container>

This would give ensure that the text rectangle of the page would be shaded
in grey and have a black border around it of 1 pt.

I thought I could achieve the same with

<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" left="0cm" top="0cm" right="0cm"
height="0cm" background-color="rgb(192, 192, 192)" border-color="rgb(0, 0,
0)" border-style="solid" border-width="1pt">
<fo:block>&#160; </fo:block>
</fo:block-container>

And I must have misread the FOP spec because I thought it said it complied
with right and bottom positions.

The problem is not huge one for me, but it is a problem nevertheless. I
can of course work out the necessary container dimensions from the relevant
margins and set the container coordinates accordingly. This works fine
unless page height/width or margin settings change within
repeating-alternatives in the page seuqence.

I hope this makes thing clearer. From your reply, however, it would seem
that FOP does not in fact support what I am trying to do (although I am told
by the XSL group that AntennaHouse and RenderX, render the above XSL as I
anticipated it would be rendered . Do you know of any workarounds?

Regards,

Mark

----- Original Message -----
From: "Chris Bowditch" <***@hotmail.com>
To: <fop-***@xml.apache.org>
Sent: Wednesday, February 18, 2004 3:21 PM
Subject: Re: position block-container relative to right and bottom
Post by Chris Bowditch
Post by Mark Williams
Hi,
I've posted a couple of messages on the xsl list and got responses re above
problem. It seems like there may be a bug in FOP re positioning relative to
right and bottom edge's of the container.
I'm not sure what you mean by this. Do you mean you want to specify the
position for the block container relative to the bottom right corner of
the page? Normally its specified relative to the top left.
Or perhaps you mean for the contents to be vertically aligned to the
bottom, then specify display-align="bottom", and horizontally aligned to
the right, text-align="right"
<snip/>
Post by Mark Williams
I would expect this to produce a grey-shaded page with a 1pt black border at
the margin edges of each page in the flow. Instead I get a miniscule box
(about 2mm sq) at the top left margins of the page.
Its true that FOP doesnt fully implement block-containers, and FOP's
implementation expects width and height to be specified
Post by Mark Williams
If, however, I do the following, I get roughly what I want.
<fo:flow flow-name="xsl-region-body">
<fo:block-container position="absolute" left="0cm" top="0cm" width="19cm"
height="27cm" background-color="rgb(192, 192, 192)" border-color="rgb(0, 0,
0)" border-style="solid" border-width="1pt">
<fo:block>&#160; </fo:block>
</fo:block-container>
Can anyone tell me if I am doing something wrong or whether this is a known
FOP problem and, if so, any workarounds please.
Fop currently only supports block-containers that are absolutely
positioned, and you need to specify top/left coordinates relative to the
top/left corner of the page, and width and height must also be present.
Chris
---------------------------------------------------------------------
Andreas L. Delmelle
2004-02-18 19:26:27 UTC
Permalink
-----Original Message-----
<snip />
And I must have misread the FOP spec because I thought it said it complied
with right and bottom positions.
You didn't misread. It does actually indicate full compliance for these
properties, but it seems to be wrong in this case... :(


Cheers,

Andreas
Chanaka Amarasekara
2004-02-19 02:50:57 UTC
Permalink
Hi,

I'm using the Apache FOP to create a PDF file. I'm having a problem in my
XSL file, where when I add a break-after = page for a table it adds an
extra blank page to the end and if I have a break-before = page it will add
an extra blank page to the beginning. Is there a way to solve this problem
(a possible workaround or a modification to the FOP)?

Thank you in advance,
Chanaka
J.Pietschmann
2004-02-19 21:15:20 UTC
Permalink
Post by Chanaka Amarasekara
I'm using the Apache FOP to create a PDF file. I'm having a problem in my
XSL file, where when I add a break-after = page for a table it adds an
extra blank page to the end and if I have a break-before = page it will add
an extra blank page to the beginning. Is there a way to solve this problem
(a possible workaround or a modification to the FOP)?
Yes, both are bugs. Getting rid of the blank page at the beginning
would require fixing the is-first-in-area code. Getting rid of the
trailing blank page is more difficult, probably impossible with the
design in the maintenance branch.
The recommended work around is to avoid inserting page breaks which
create blank pages at the XSLT level.

J.Pietschmann
John Austin
2004-02-20 00:27:40 UTC
Permalink
Post by J.Pietschmann
Post by Chanaka Amarasekara
I'm using the Apache FOP to create a PDF file. I'm having a problem in my
XSL file, where when I add a break-after = page for a table it adds an
extra blank page to the end and if I have a break-before = page it will add
an extra blank page to the beginning.
Yes, both are bugs. Getting rid of the blank page at the beginning
would require fixing the is-first-in-area code. Getting rid of the
trailing blank page is more difficult,
And all this time I thought it was MY fault!
--
John Austin <***@sympatico.ca>
Chanaka Amarasekara
2004-02-25 06:25:13 UTC
Permalink
Hi,

I'm using FOP 0.20.5. I found out that if you do one of the following it
will solve this problem,
1) to wrap the fo:table around a fo:block and put the page-break to that
(Bug 7487)
2) enter the entry "force-page-count="no-force" to every fo:page-sequence.
(http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences)


unfortunately, non of these worked but maybe it might work for you. Any
ideas why it not working.

Regards,
Chanaka
Post by J.Pietschmann
Post by Chanaka Amarasekara
I'm using the Apache FOP to create a PDF file. I'm having a problem in my
XSL file, where when I add a break-after = page for a table it adds an
extra blank page to the end and if I have a break-before = page it will add
an extra blank page to the beginning.
Yes, both are bugs. Getting rid of the blank page at the beginning
would require fixing the is-first-in-area code. Getting rid of the
trailing blank page is more difficult,
And all this time I thought it was MY fault!

--
John Austin <***@sympatico.ca>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-***@xml.apache.org
For additional commands, e-mail: fop-user-***@xml.apache.org

Continue reading on narkive:
Loading...