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 William Yu <wy...@e-paga.com> on 2008/08/18 14:29:13 UTC

Border problem with dynamic content

I'm fairly new to FOP and I have a problem I haven't been able to solve.  My
goal is to have rectangular (8X10) border (top, bottom, left right) on every
single page of my document regardless if the content will fill up the page
or not. The problem I'm having is that border basically stops when the
content ends on subsequent pages.  I can not predict the amount of data that
will coming from an XML file so the content size will vary. I would like the
border to extend to the bottom of every page, even if the content does not
fill up the whole page.

Below is example of my code for your review.
<fo:table table-omit-header-at-break="false"
    table-layout="fixed"
    height="100%"
   width="18cm"
   border-collapse="separate"
   border-style="solid"
   border-width="2pt"
   border-color="black"
   border-before-width="2pt"
   border-before-width.conditionality="retain"
   border-after-width="2pt"
   border-after-width.conditionality="retain">
   <fo:table-body>
       <fo:table-row>
           <fo:table-cell>
               <fo:block>
                   <xsl:for-each select="//*">
                       NAME: <xsl:value-of select="name()"/>
                       <xsl:if test="count(node()) = 1">
                        VALUE: <xsl:value-of select="node()"/>
                        </xsl:if>
                        <xsl:if test="not(count(node()) = 1)">
                        LENGTH: <xsl:value-of select="count(node())"/>
                        </xsl:if>
                        <!--VALUE: <xsl:value-of
select="node()[(string(.))]"/> -->
                        <fo:block />
                    </xsl:for-each>
                </fo:block>
            </fo:table-cell>
        </fo:table-row>
    </fo:table-body>
</fo:table>
 
Thanks in advance,
William

-- 
View this message in context: http://www.nabble.com/Border-problem-with-dynamic-content-tp19030648p19030648.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Border problem with dynamic content

Posted by Luca Furini <lu...@gmail.com>.
On Tue, Aug 26, 2008 at 4:23 PM, Jeremias Maerki <de...@jeremias-maerki.ch> wrote:

>> For the other devs: what if I modify the validation message concerning
>> borders / paddings on regions so that it says something like "this is
>> not strictly valid, but if you really need it ..."?
>
> Maybe just: "(non-standard behaviour available if relaxed validation is
> enabled)"

Thanks for the hint, I ended up using something very close to it.
I just wrote "non-standard values" as "non-standard behaviour" made me
think of something unpredictable and hazardous :-)

    Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Border problem with dynamic content

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 25.08.2008 12:01:32 Luca Furini wrote:
> On Tue, Aug 19, 2008 at 9:06 AM, Chris Bowditch
> <bo...@hotmail.com> wrote:
> 
> > You are going to need to put the border on fo:region-body and make the
> > fo:region-body extend to the edge of the page. Strictly speaking this is not
> > allowed by the XSL-FO specification but I believe FOP allows it.
> 
> (hoping this does not come too late)
> Borders on regions should work, but relaxed validation must be turned
> on (with the -r option on the command line, for example) otherwise the
> validation error prevents the creation of the pdf.
> 
> For the other devs: what if I modify the validation message concerning
> borders / paddings on regions so that it says something like "this is
> not strictly valid, but if you really need it ..."?

Maybe just: "(non-standard behaviour available if relaxed validation is
enabled)"

> HTH
>     Luca



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Border problem with dynamic content

Posted by Luca Furini <lu...@gmail.com>.
On Tue, Aug 19, 2008 at 9:06 AM, Chris Bowditch
<bo...@hotmail.com> wrote:

> You are going to need to put the border on fo:region-body and make the
> fo:region-body extend to the edge of the page. Strictly speaking this is not
> allowed by the XSL-FO specification but I believe FOP allows it.

(hoping this does not come too late)
Borders on regions should work, but relaxed validation must be turned
on (with the -r option on the command line, for example) otherwise the
validation error prevents the creation of the pdf.

For the other devs: what if I modify the validation message concerning
borders / paddings on regions so that it says something like "this is
not strictly valid, but if you really need it ..."?

HTH
    Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Border problem with dynamic content

Posted by Chris Bowditch <bo...@hotmail.com>.
William Yu wrote:

> I'm fairly new to FOP and I have a problem I haven't been able to solve.  My
> goal is to have rectangular (8X10) border (top, bottom, left right) on every
> single page of my document regardless if the content will fill up the page
> or not. The problem I'm having is that border basically stops when the
> content ends on subsequent pages.  I can not predict the amount of data that
> will coming from an XML file so the content size will vary. I would like the
> border to extend to the bottom of every page, even if the content does not
> fill up the whole page.

You are goingt to need to put the border on fo:region-body and make the 
fo:region-body extend to the edge of the page. Strictly speaking this is 
not allowed by the XSL-FO specification but I believe FOP allows it. If 
you have side regions, i.e. fo:static-content then this approach may not 
work for you.

<snip/>

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org