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 Vangelis Karageorgos <va...@osmosis.gr> on 2008/05/02 21:39:24 UTC

Page bottom padding

Hi everybody,

there's a question we've been confronted with during our development process
using FOP.
Is page bottom padding possible to materialize in FOP, while constructing a
layout with several columns and flow from one onto another?

Thanks in advance,

Re: I need a little more help please.

Posted by Jay Bryant <ja...@bryantcs.com>.
Hi, Sheldon,

Since this is a purely XSLT issue, you'd get more (and possibly 
more-on-target) responses on the XSL list:
http://www.mulberrytech.com/xsl/xsl-list/

It's not that we FOP-lovers hate XSLT - just the opposite, in fact. It's 
just that XSLT isn't the focus of this list.

When I run your transform, I get elements from the headerline part of the 
transform.

For one run, I added a static attribute to each table being created by that 
for-each instruction, thus:
<fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" 
id="{count(preceding-sibling::headerline)}">

I got these two table start lines:
<fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" 
id="0">
<fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" 
id="1">

So your transform is finding the headerline elements.

However, when I ran the transform, I did not get any content for the rows 
(that is, I got no cell elements in the row elements). That was because your 
XML has hdr_itm elements, but your XSLT was looking for hdr_item elements 
(not the extra e) - probably a typo.

I corrected that and have attached the file as t.xsl.

I also made a greatly modified version in which I ditched all the variables 
(except product_list, since I assume you're going to write a nodeset into 
that one and then use it later) and ditched the for-eaches to use templates 
instead. I avoid variables that do nothing more than hold a reference to a 
node. I also use templates wherever I can. I find that both of those 
practices make a transform easier to read and thus easier to maintain. Also, 
the modified transform is 1000 bytes smaller than the original (a sign that 
it's ultimately simpler). I attached that file as t_jb.xsl. (And yes, it's a 
slow evening, though my favorite of the two teams is winning the game right 
now.)

If you wish to ignore the arrogant know-it-all and just use your original 
file, use t.xsl. If you want to try it my way, use t_jb.xsl. I know you've 
got much more to do in this transform and that you can't just substitute 
files, but I'm sure you get the idea.

Let me know (preferably on list, as others may have the same questions 
someday) if you need more help.

Happy programming.

Jay Bryant

----- Original Message ----- 
From: "Sheldon Glickler" <sh...@thevillages.net>
To: <fo...@xmlgraphics.apache.org>
Sent: Monday, October 13, 2008 6:03 PM
Subject: I need a little more help please.


>I have reduced my xsl to a minimum so that I can generated data to write
> an xml.  I can't find why my two "headerline"s are not appearing.  (I
> have reduced this example to as small as I can).  I have included the 
> files.
>


--------------------------------------------------------------------------------


> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                              xmlns:fo="http://www.w3.org/1999/XSL/Format">
>
> <xsl:template match="print-compliance">
>  <xsl:processing-instruction 
> name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
>  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>    <fo:layout-master-set>
>      <fo:simple-page-master master-name="compliance-form"
>         margin-top="50pt"
>         margin-bottom="50pt"
>         margin-left="15pt"
>         margin-right="20pt"
>         page-height="8.5in"
>         page-width="11in">
>        <fo:region-body margin-bottom="1pt"/>
>      </fo:simple-page-master>
>    </fo:layout-master-set>
>    <fo:page-sequence master-reference="compliance-form">
>      <fo:flow flow-name="xsl-region-body">
>        <xsl:apply-templates select="header" />
>      </fo:flow>
>    </fo:page-sequence>
>  </fo:root>
> </xsl:template>
>
> <xsl:template match="header">
>  <fo:table table-layout="fixed" border-collapse="collapse" 
> space-before="0pt" border-style="none">
>    <xsl:variable name="product_list" select="product_list" />
>    <xsl:variable name="title_bg_color" select="title_bg_color" />
>    <xsl:variable name="color" select="color" />
>    <xsl:variable name="linespace" select="linespace" />
>    <xsl:variable name="fullwidth" select="fullwidth" />
>    <xsl:variable name="fontsize" select="fontsize" />
>    <xsl:variable name="fontweight" select="fontweight" />
>    <xsl:variable name="border" select="border" />
>    <fo:table-column column-width="{$fullwidth}"/>
>    <fo:table-body >
>    <fo:table-row>
>        <fo:table-cell background-color="{$title_bg_color}" >
>          <fo:block text-align="center" wrap-option="no-wrap" 
> font-size="{$fontsize}" line-height="{$linespace}"
>                        font-weight="{$fontweight}" color="{$color}" 
> border="{$border}">
>            <xsl:value-of select="report_name"/>
>          </fo:block>
>        </fo:table-cell>
>      </fo:table-row>
>    </fo:table-body>
>  </fo:table>
>  <xsl:for-each select="headerline">
>  <fo:table table-layout="fixed" border-collapse="collapse" 
> space-before="0pt">
>      <xsl:variable name="border" select="border" />
>      <xsl:variable name="fontweight" select="fontweight" />
>      <xsl:variable name="linespace" select="linespace" />
>      <xsl:variable name="wrap" select="wrap" />
>    <xsl:for-each select="colsize">
> <xsl:variable name="width" select="value" />
> <fo:table-column column-width="{$width}"/>
>    </xsl:for-each>
>    <fo:table-body>
>      <fo:table-row line-height="{$linespace}">
>      <xsl:for-each select="hdr_item">
>            <fo:table-cell wrap-option="{$wrap}">
>            <xsl:variable name="align" select="align" />
>            <xsl:variable name="color" select="color" />
>            <xsl:variable name="fontsize" select="fontsize" />
>            <xsl:variable name="bg_color" select="bg_color" />
>            <xsl:variable name="color" select="color" />
>              <fo:block text-align="{$align}" font-size="{$fontsize}" 
> border="{$border}"
>                    font-weight="{$fontweight}" color="{$color}" 
> background-color='{$bg_color}'>
>                <xsl:value-of select="value"/>
>              </fo:block>
>            </fo:table-cell>
>          </xsl:for-each>
>        </fo:table-row>
>      </fo:table-body>
>  </fo:table>
>  </xsl:for-each>
> </xsl:template>
>
> </xsl:stylesheet>
>


--------------------------------------------------------------------------------


> <?xml version="1.0" encoding="utf-8"?>
> <print-compliance>
> <header>
> <bg_color>rgb(255,190,160)</bg_color>
> <title_bg_color>darkgray</title_bg_color>
> <fontweight>bold</fontweight>
> <color>maroon</color>
> <report_name>TITLE</report_name>
> <fullwidth>400pt</fullwidth>
> <fontsize>10pt</fontsize>
> <linespace>15pt</linespace>
> <border>none</border>
> <headerline>
> <linespace>10pt</linespace>
> <fontweight>bold</fontweight>
> <border>solid 1pt</border>
> <wrap>no-wrap</wrap>
> <colsize><value>300pt</value></colsize>
> <colsize><value>50pt</value></colsize>
> <colsize><value>50pt</value></colsize>
> <hdr_itm>
> <value>COMMODITY  </value>
> <bg_color>darkgray</bg_color>
> <color>black</color>
> <fontsize>8pt</fontsize>
> <align>end</align>
> </hdr_itm>
> <hdr_itm>
> <value>Subtitle 1</value>
> <bg_color>rgb(255,190,160)</bg_color>
> <color>black</color>
> <fontsize>6pt</fontsize>
> <align>center</align>
> </hdr_itm>
> <hdr_itm>
> <value>Subtitle 1</value>
> <bg_color>darkgray</bg_color>
> <color>black</color>
> <fontsize>6pt</fontsize>
> <align>center</align>
> </hdr_itm>
> </headerline>
> <headerline>
> <linespace>8pt</linespace>
> <fontweight>bold</fontweight>
> <wrap>no-wrap</wrap>
> <colsize><value>120pt</value></colsize>
> <colsize><value>60pt</value></colsize>
> <colsize><value>60pt</value></colsize>
> <colsize><value>30pt</value></colsize>
> <colsize><value>30pt</value></colsize>
> <colsize><value>50pt</value></colsize>
> <colsize><value>50pt</value></colsize>
> <hdr_itm>
> <value>LOCATION</value>
> <align>start</align>
> <fontsize>8pt</fontsize>
> <color>black</color>
> <bg_color>rgb(255,190,160)</bg_color>
> <border>solid .5pt</border>
> </hdr_itm>
> <hdr_itm>
> <value>RESPONSIBILITY</value>
> <fontsize>8pt</fontsize>
> <align>start</align>
> <color>black</color>
> <bg_color>rgb(255,190,160)</bg_color>
> <border>solid .5pt</border>
> </hdr_itm>
> <hdr_itm>
> <value>VICE PRESIDENT</value>
> <fontsize>8pt</fontsize>
> <align>start</align>
> <color>black</color>
> <bg_color>rgb(255,190,160)</bg_color>
> <border>solid .5pt</border>
> </hdr_itm>
> <hdr_itm>
> <value>LOG / FIN CO.</value>
> <fontsize>8pt</fontsize>
> <color>black</color>
> <align>center</align>
> <bg_color>rgb(255,190,160)</bg_color>
> <border>solid .5pt</border>
> </hdr_itm>
> <hdr_itm>
> <value>DIM.</value>
> <fontsize>8pt</fontsize>
> <color>black</color>
> <bg_color>rgb(255,190,160)</bg_color>
> <border>solid .5pt</border>
> <align>center</align>
> </hdr_itm>
> <hdr_itm>
> <value>COMPANY 1</value>
> <color>black</color>
> <bg_color>rgb(255,190,160)</bg_color>
> <fontsize>8pt</fontsize>
> <border>solid 1pt</border>
> <align>center</align>
> </hdr_itm>
> <hdr_itm>
> <value>COMPANY 2</value>
> <fontsize>8pt</fontsize>
> <bg_color>darkgray</bg_color>
> <border>solid 1pt</border>
> <align>center</align>
> </hdr_itm>
> </headerline>
> </header>
> </print-compliance>


--------------------------------------------------------------------------------


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


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


I need a little more help please.

Posted by Sheldon Glickler <sh...@thevillages.net>.
I have reduced my xsl to a minimum so that I can generated data to write 
an xml.  I can't find why my two "headerline"s are not appearing.  (I 
have reduced this example to as small as I can).  I have included the files.

Re: Newbie needs a little help

Posted by Sheldon Glickler <sh...@thevillages.net>.
Brown, Phyllis (NIH/NIEHS) [C] wrote:
> It looks like you have 2 problems: 
> - You need to add <fo:block> around both <xsl:value-of select="value"/>
> - You need to select the bu_summary level in order to select the
> summary_item within it (therefore you need a loop on bu_summary) 

Thank you very much.  That did the trick.  (Actually, I removed the 
bu_summary tag because there is only one summary line per bu, so I 
didn't need a loop there after all).


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


RE: Newbie needs a little help

Posted by "Brown, Phyllis (NIH/NIEHS) [C]" <Br...@niehs.nih.gov>.
It looks like you have 2 problems: 
- You need to add <fo:block> around both <xsl:value-of select="value"/>
- You need to select the bu_summary level in order to select the
summary_item within it (therefore you need a loop on bu_summary) 

-----Original Message-----
From: Sheldon Glickler [mailto:sheldonlg@thevillages.net] 
Sent: Monday, October 13, 2008 12:20 PM
To: fop-users@xmlgraphics.apache.org
Subject: Newbie needs a little help

I am trying to put together a report and have been learning fop and xsl.

   I have attached the xsl and xml that I am writing.  My question is 
"why don't the last two lines in this setup appear?"  That is, why 
doesn't the data line show up nor the summary line.  The business unit 
title line does show up.  These three lines are separate tables in the 
template "business_units".

I **must** use version .20-5.  I am designing this with as much use of 
loops as I can, because I don't, a priori, know how many business units 
I will have nor how many lines within a business unit not how many 
companies for each business unit.  The end goal of this is to write code

to generate the xml from data and use the xsl that will handle the 
general case.

Thanks for any help.

Newbie needs a little help

Posted by Sheldon Glickler <sh...@thevillages.net>.
I am trying to put together a report and have been learning fop and xsl. 
   I have attached the xsl and xml that I am writing.  My question is 
"why don't the last two lines in this setup appear?"  That is, why 
doesn't the data line show up nor the summary line.  The business unit 
title line does show up.  These three lines are separate tables in the 
template "business_units".

I **must** use version .20-5.  I am designing this with as much use of 
loops as I can, because I don't, a priori, know how many business units 
I will have nor how many lines within a business unit not how many 
companies for each business unit.  The end goal of this is to write code 
to generate the xml from data and use the xsl that will handle the 
general case.

Thanks for any help.

Re: Page bottom padding

Posted by George Tsopouridis <gt...@gmail.com>.
Thanks Jeremias again... My problem solved with start/end indent. I am sorry
but with padding-top;;;

Jeremias Maerki-2 wrote:
> 
> That approach won't work because it doesn't affect the text indentation
> due to XSL-FO's box model. Details in the XSL-FO spec. In short: you
> need to set start-indent and end-indent, too.
> 
> On 08.10.2008 16:01:37 George Tsopouridis wrote:
>> 
>> Thank you very much Jeremias Maerki for your answer at this question. I
>> had
>> the same problem, and i enclosed all region-body content in a block with
>> padding-after="2cm" padding-after.conditionality="retain".
>> The result is perfect. I have region-body padding-bottom.
>> Bud with the properties padding-left/right="2cm"
>> padding-left/right.conditionality="retain" or padding-start/end="2cm"
>> padding-start/end.conditionality="retain", i have no result.
>> What can i do with padding-left/right in my region-body;;;
>> 
>> Thanks in advance,
>> 
>> 
>> Jeremias Maerki-2 wrote:
>> > 
>> > Not sure I understand you correctly. There are various way to generate
>> > "padding" at the page bottom:
>> > 
>> > - margin-bottom on fo:simple-page-master
>> > - margin-bottom on fo:region-body
>> > - Enclose all your content in an fo:block and specify:
>> >    padding-after="2cm" padding-after.conditionality="retain"
>> > 
>> > Depends on what effect you need exactly.
>> > 
>> > HTH
>> > 
>> > On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
>> >> Hi everybody,
>> >> 
>> >> there's a question we've been confronted with during our development
>> >> process
>> >> using FOP.
>> >> Is page bottom padding possible to materialize in FOP, while
>> constructing
>> >> a
>> >> layout with several columns and flow from one onto another?
>> >> 
>> >> Thanks in advance,
>> > 
>> > 
>> > 
>> > 
>> > Jeremias Maerki
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Page-bottom-padding-tp17026454p19879355.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Page-bottom-padding-tp17026454p19956424.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: Page bottom padding

Posted by George Tsopouridis <gt...@gmail.com>.
Jeremias thanks again for your total help, but i need something else. If i
enclose all my content in an fo:block and with start-indent and end-indent
(for padding left/right), and also i have 2 columns in my region-body, the
value of start-indent(or end -indent) passes to every block inside my total
block. Value of start-indent exists between two columns. I understand this
behavior, but can i keep start-indent only in total block which contains all
content(other blocks with columns);; I tried start -indent = 0 at the
content blocks but nothing. Is there a solution; I need padding-left in my
region-body.


> Thanks in advance...

Jeremias Maerki-2 wrote:
> 
> That approach won't work because it doesn't affect the text indentation
> due to XSL-FO's box model. Details in the XSL-FO spec. In short: you
> need to set start-indent and end-indent, too.
> 
> On 08.10.2008 16:01:37 George Tsopouridis wrote:
>> 
>> Thank you very much Jeremias Maerki for your answer at this question. I
>> had
>> the same problem, and i enclosed all region-body content in a block with
>> padding-after="2cm" padding-after.conditionality="retain".
>> The result is perfect. I have region-body padding-bottom.
>> Bud with the properties padding-left/right="2cm"
>> padding-left/right.conditionality="retain" or padding-start/end="2cm"
>> padding-start/end.conditionality="retain", i have no result.
>> What can i do with padding-left/right in my region-body;;;
>> 
>> Thanks in advance,
>> 
>> 
>> Jeremias Maerki-2 wrote:
>> > 
>> > Not sure I understand you correctly. There are various way to generate
>> > "padding" at the page bottom:
>> > 
>> > - margin-bottom on fo:simple-page-master
>> > - margin-bottom on fo:region-body
>> > - Enclose all your content in an fo:block and specify:
>> >    padding-after="2cm" padding-after.conditionality="retain"
>> > 
>> > Depends on what effect you need exactly.
>> > 
>> > HTH
>> > 
>> > On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
>> >> Hi everybody,
>> >> 
>> >> there's a question we've been confronted with during our development
>> >> process
>> >> using FOP.
>> >> Is page bottom padding possible to materialize in FOP, while
>> constructing
>> >> a
>> >> layout with several columns and flow from one onto another?
>> >> 
>> >> Thanks in advance,
>> > 
>> > 
>> > 
>> > 
>> > Jeremias Maerki
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Page-bottom-padding-tp17026454p19879355.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Page-bottom-padding-tp17026454p19998433.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: Page bottom padding

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
That approach won't work because it doesn't affect the text indentation
due to XSL-FO's box model. Details in the XSL-FO spec. In short: you
need to set start-indent and end-indent, too.

On 08.10.2008 16:01:37 George Tsopouridis wrote:
> 
> Thank you very much Jeremias Maerki for your answer at this question. I had
> the same problem, and i enclosed all region-body content in a block with
> padding-after="2cm" padding-after.conditionality="retain".
> The result is perfect. I have region-body padding-bottom.
> Bud with the properties padding-left/right="2cm"
> padding-left/right.conditionality="retain" or padding-start/end="2cm"
> padding-start/end.conditionality="retain", i have no result.
> What can i do with padding-left/right in my region-body;;;
> 
> Thanks in advance,
> 
> 
> Jeremias Maerki-2 wrote:
> > 
> > Not sure I understand you correctly. There are various way to generate
> > "padding" at the page bottom:
> > 
> > - margin-bottom on fo:simple-page-master
> > - margin-bottom on fo:region-body
> > - Enclose all your content in an fo:block and specify:
> >    padding-after="2cm" padding-after.conditionality="retain"
> > 
> > Depends on what effect you need exactly.
> > 
> > HTH
> > 
> > On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
> >> Hi everybody,
> >> 
> >> there's a question we've been confronted with during our development
> >> process
> >> using FOP.
> >> Is page bottom padding possible to materialize in FOP, while constructing
> >> a
> >> layout with several columns and flow from one onto another?
> >> 
> >> Thanks in advance,
> > 
> > 
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Page-bottom-padding-tp17026454p19879355.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 



Jeremias Maerki


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


Re: Page bottom padding

Posted by George Tsopouridis <gt...@gmail.com>.
Thank you very much Jeremias Maerki for your answer at this question. I had
the same problem, and i enclosed all region-body content in a block with
padding-after="2cm" padding-after.conditionality="retain".
The result is perfect. I have region-body padding-bottom.
Bud with the properties padding-left/right="2cm"
padding-left/right.conditionality="retain" or padding-start/end="2cm"
padding-start/end.conditionality="retain", i have no result.
What can i do with padding-left/right in my region-body;;;

Thanks in advance,


Jeremias Maerki-2 wrote:
> 
> Not sure I understand you correctly. There are various way to generate
> "padding" at the page bottom:
> 
> - margin-bottom on fo:simple-page-master
> - margin-bottom on fo:region-body
> - Enclose all your content in an fo:block and specify:
>    padding-after="2cm" padding-after.conditionality="retain"
> 
> Depends on what effect you need exactly.
> 
> HTH
> 
> On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
>> Hi everybody,
>> 
>> there's a question we've been confronted with during our development
>> process
>> using FOP.
>> Is page bottom padding possible to materialize in FOP, while constructing
>> a
>> layout with several columns and flow from one onto another?
>> 
>> Thanks in advance,
> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Page-bottom-padding-tp17026454p19879355.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: Page bottom padding

Posted by Andreas Delmelle <an...@telenet.be>.
On May 6, 2008, at 10:03, Jeremias Maerki wrote:
>>
>> Take
>>
>> <fo:block linefeed-treatment="preserve">
>> line1
>> line2
>> line3
>> </fo:block>
>>
>> If you use display-align on an ancestor table-cell or block-
>> container, that would only specify something about a constraint on
>> the placement of the block as a whole.
>
> You forget line-height which can be specified as a "<space>". Too  
> bad we
> don't support that variant, yet. And once we have it, it's going to
> throw our test suite upside down because we'll have to fix a lot of
> checks. ;-)

:-)

Hmm, and percentages on <space> are not defined, percentages on line- 
height are computed relative to the font-size.

If <space> line-heights were implemented, then what could work,  
maybe, is property value functions...

Something like

<fo:block-container block-progression-dimension="100%">
   <fo:block linefeed-treatment="preserve"
             line-height.minimum="1"
             line-height.optimum="1.2"
             line-height.maximum="inherited-property-value(block- 
progression-dimension)">
   line1
   line2
   line3
   </fo:block>
</fo:block-container>


should then spread the three lines over the full reference-area  
height, IIC.

Cheers

Andreas

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


Re: Page bottom padding

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 05.05.2008 20:25:58 Andreas Delmelle wrote:
> On May 5, 2008, at 20:06, Vincent Hennebert wrote:
> > kindaian a écrit :
> >>
> >> This is what I wanted it to happen:
> >> ---- top of page
> >> |XXXXX -block one
> >> |
> >> |XXXXX -block two
> >> |
> >> |XXXXX -block three
> >> ---- bottom of the page
> >>
> >> I think what I'm looking can be called "vertical-justify". And is
> >> something very useful to make layouts like yellow pages and the like
> >> (lots of small blocks of text, spread on several columns in the page,
> >> justified to the top and bottom of the page).
> >
> > There’s no need for a vertical-justify setting to achieve this. You  
> > can
> > just specify elastic spaces between the blocks:
> >     <fo:block space-after.minimum="0"
> >               space-after.optimum="0"
> >               space-after.maximum="30pt">block one</fo:block>
> >     etc.
> >
> > FOP will use the amount of stretchable whitespace that’s avaialable to
> > “justify” the content on the page.
> 
> FWIW: What I think XSL-FO currently does not have, is a way to tell  
> the formatter to distribute the lines evenly over an area.

But Vincent's example tries to do exactly that and it's a valid FO
approach with no proprietary extensions.

> Take
> 
> <fo:block linefeed-treatment="preserve">
> line1
> line2
> line3
> </fo:block>
> 
> If you use display-align on an ancestor table-cell or block- 
> container, that would only specify something about a constraint on  
> the placement of the block as a whole.

You forget line-height which can be specified as a "<space>". Too bad we
don't support that variant, yet. And once we have it, it's going to
throw our test suite upside down because we'll have to fix a lot of
checks. ;-)

> Something like display-align="justify" does not exist. I do see  
> references in the code towards the beginning of an implementation,  
> though.

Yes, Luca did some experiments there way back when the Knuth approach
was introduced. Some of this still works somewhat but it is not backed
be the necessary tests.

> 
> Cheers
> 
> Andreas




Jeremias Maerki


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


Re: Page bottom padding

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
kindaian wrote:
> Vincent Hennebert escreveu:
<snip/>
>> But I think that Vangelis’ requirement was to make visible the amount of
>> whitespace left at the bottom of a column by the layout algorithm, when
>> no elastic space is available. In which case I’m afraid I can’t think of
>> any FO construction to achieve that. But maybe you will find the above
>> hint useful, after all.
>>
>>
> There is a simple trick...
>
> |------------------|
> ||----------------||
> ||  block 1       ||
> ||----------------||
> ||----------------||
> ||  block 2       ||
> ||----------------||
> ||----------------||
> ||  block 3       ||
> ||----------------||
> |                  |
> |  unused space    |
> |------------------|
>
> Just add a colored background in the table column.
> And add the "indented-normal" colour in background of each block. Some
> actual tests may be needed to check if this trick would do the expected
> result.

Neat idea! More generally, setting a background-color on the region-body
element, and surrounding the content of fo:flow by a block that resets
the background should do the job:
    <fo:layout-master-set>
      <fo:simple-page-master master-name="page" page-width="21"
        page-height="29.7" margin="2cm">
        <fo:region-body background-color="yellow"/>
      </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="page">
      <fo:flow flow-name="xsl-region-body">
        <fo:block background-color="white">
          <!-- here the real content... -->
          ...


> The result will be that the unused space will appear coloured.
>
> Is this what you need Vangelis?
>
> Cheers
> ;)
>
> p.s.- this could be used to pre-render and ascertain  block dimensions
> in a pdf engine, naturally, different output targets would generate
> different results (I've to think about this, because this gives me some
> interesting ideas).
>
> p.s.- and thank you for the tip on the "elastic" spacing...

You’re welcome :-)

<snip/>

Vincent


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

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


Re: Page bottom padding

Posted by "kindaian@gmail.com" <ki...@gmail.com>.
Vincent Hennebert escreveu:
> Hi,
>
> kindaian a écrit :
>   
>> Some time ago I had a similar requirement. May happen it is the same. I
>> have blocks in the format
>>
>> This is what I was getting:
>> ---- top of page
>> | XXXXX -block one
>> | XXXXX -block two
>> | XXXXX - block three
>> |
>> |
>> ---- bottom of page
>>
>> This is what I wanted it to happen:
>> ---- top of page
>> |XXXXX -block one
>> |
>> |XXXXX -block two
>> |
>> |XXXXX -block three
>> ---- bottom of the page
>>
>> I think what I'm looking can be called "vertical-justify". And is
>> something very useful to make layouts like yellow pages and the like
>> (lots of small blocks of text, spread on several columns in the page,
>> justified to the top and bottom of the page).
>>     
>
> There’s no need for a vertical-justify setting to achieve this. You can
> just specify elastic spaces between the blocks:
>     <fo:block space-after.minimum="0"
>               space-after.optimum="0"
>               space-after.maximum="30pt">block one</fo:block>
>     etc.
>
> FOP will use the amount of stretchable whitespace that’s avaialable to
> “justify” the content on the page.
>
>
> But I think that Vangelis’ requirement was to make visible the amount of
> whitespace left at the bottom of a column by the layout algorithm, when
> no elastic space is available. In which case I’m afraid I can’t think of
> any FO construction to achieve that. But maybe you will find the above
> hint useful, after all.
>
>   
There is a simple trick...

|------------------|
||----------------||
||  block 1       ||
||----------------||
||----------------||
||  block 2       ||
||----------------||
||----------------||
||  block 3       ||
||----------------||
|                  |
|  unused space    |
|------------------|

Just add a colored background in the table column.
And add the "indented-normal" colour in background of each block. Some 
actual tests may be needed to check if this trick would do the expected 
result.

The result will be that the unused space will appear coloured.

Is this what you need Vangelis?

Cheers
;)

p.s.- this could be used to pre-render and ascertain  block dimensions 
in a pdf engine, naturally, different output targets would generate 
different results (I've to think about this, because this gives me some 
interesting ideas).

p.s.- and thank you for the tip on the "elastic" spacing...

>   
>> Jeremias Maerki escreveu:
>>     
>>> Not sure I understand you correctly. There are various way to generate
>>> "padding" at the page bottom:
>>>
>>> - margin-bottom on fo:simple-page-master
>>> - margin-bottom on fo:region-body
>>> - Enclose all your content in an fo:block and specify:
>>>    padding-after="2cm" padding-after.conditionality="retain"
>>>
>>> Depends on what effect you need exactly.
>>>
>>> HTH
>>>
>>> On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
>>>
>>>       
>>>> Hi everybody,
>>>>
>>>> there's a question we've been confronted with during our development
>>>> process
>>>> using FOP.
>>>> Is page bottom padding possible to materialize in FOP, while
>>>> constructing a
>>>> layout with several columns and flow from one onto another?
>>>>
>>>> Thanks in advance,
>>>>         
>
> HTH,
> Vincent
>
>
>   


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


Re: Page bottom padding

Posted by Andreas Delmelle <an...@telenet.be>.
On May 5, 2008, at 20:06, Vincent Hennebert wrote:
> kindaian a écrit :
>>
>> This is what I wanted it to happen:
>> ---- top of page
>> |XXXXX -block one
>> |
>> |XXXXX -block two
>> |
>> |XXXXX -block three
>> ---- bottom of the page
>>
>> I think what I'm looking can be called "vertical-justify". And is
>> something very useful to make layouts like yellow pages and the like
>> (lots of small blocks of text, spread on several columns in the page,
>> justified to the top and bottom of the page).
>
> There’s no need for a vertical-justify setting to achieve this. You  
> can
> just specify elastic spaces between the blocks:
>     <fo:block space-after.minimum="0"
>               space-after.optimum="0"
>               space-after.maximum="30pt">block one</fo:block>
>     etc.
>
> FOP will use the amount of stretchable whitespace that’s avaialable to
> “justify” the content on the page.

FWIW: What I think XSL-FO currently does not have, is a way to tell  
the formatter to distribute the lines evenly over an area.

Take

<fo:block linefeed-treatment="preserve">
line1
line2
line3
</fo:block>

If you use display-align on an ancestor table-cell or block- 
container, that would only specify something about a constraint on  
the placement of the block as a whole.

Something like display-align="justify" does not exist. I do see  
references in the code towards the beginning of an implementation,  
though.


Cheers

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


Re: Page bottom padding

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
Hi,

kindaian a écrit :
> Some time ago I had a similar requirement. May happen it is the same. I
> have blocks in the format
>
> This is what I was getting:
> ---- top of page
> | XXXXX -block one
> | XXXXX -block two
> | XXXXX - block three
> |
> |
> ---- bottom of page
>
> This is what I wanted it to happen:
> ---- top of page
> |XXXXX -block one
> |
> |XXXXX -block two
> |
> |XXXXX -block three
> ---- bottom of the page
>
> I think what I'm looking can be called "vertical-justify". And is
> something very useful to make layouts like yellow pages and the like
> (lots of small blocks of text, spread on several columns in the page,
> justified to the top and bottom of the page).

There’s no need for a vertical-justify setting to achieve this. You can
just specify elastic spaces between the blocks:
    <fo:block space-after.minimum="0"
              space-after.optimum="0"
              space-after.maximum="30pt">block one</fo:block>
    etc.

FOP will use the amount of stretchable whitespace that’s avaialable to
“justify” the content on the page.


But I think that Vangelis’ requirement was to make visible the amount of
whitespace left at the bottom of a column by the layout algorithm, when
no elastic space is available. In which case I’m afraid I can’t think of
any FO construction to achieve that. But maybe you will find the above
hint useful, after all.


> Jeremias Maerki escreveu:
>> Not sure I understand you correctly. There are various way to generate
>> "padding" at the page bottom:
>>
>> - margin-bottom on fo:simple-page-master
>> - margin-bottom on fo:region-body
>> - Enclose all your content in an fo:block and specify:
>>    padding-after="2cm" padding-after.conditionality="retain"
>>
>> Depends on what effect you need exactly.
>>
>> HTH
>>
>> On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
>>
>>> Hi everybody,
>>>
>>> there's a question we've been confronted with during our development
>>> process
>>> using FOP.
>>> Is page bottom padding possible to materialize in FOP, while
>>> constructing a
>>> layout with several columns and flow from one onto another?
>>>
>>> Thanks in advance,

HTH,
Vincent


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

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


Re: Page bottom padding

Posted by "kindaian@gmail.com" <ki...@gmail.com>.
Some time ago I had a similar requirement. May happen it is the same. I 
have blocks in the format

This is what I was getting:
---- top of page
| XXXXX -block one
| XXXXX -block two
| XXXXX - block three
|
|
---- bottom of page

This is what I wanted it to happen:
---- top of page
|XXXXX -block one
|
|XXXXX -block two
|
|XXXXX -block three
---- bottom of the page

I think what I'm looking can be called "vertical-justify". And is 
something very useful to make layouts like yellow pages and the like 
(lots of small blocks of text, spread on several columns in the page, 
justified to the top and bottom of the page).

I think that at the time, a management of the paddings and padding 
conditions would manage the wanted effect.

[there was another issue regarding space management but that isn't the 
issue here hehehe]

Cheers,
Kindaian

Jeremias Maerki escreveu:
> Not sure I understand you correctly. There are various way to generate
> "padding" at the page bottom:
>
> - margin-bottom on fo:simple-page-master
> - margin-bottom on fo:region-body
> - Enclose all your content in an fo:block and specify:
>    padding-after="2cm" padding-after.conditionality="retain"
>
> Depends on what effect you need exactly.
>
> HTH
>
> On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
>   
>> Hi everybody,
>>
>> there's a question we've been confronted with during our development process
>> using FOP.
>> Is page bottom padding possible to materialize in FOP, while constructing a
>> layout with several columns and flow from one onto another?
>>
>> Thanks in advance,
>>     
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>   


Re: Page bottom padding

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Not sure I understand you correctly. There are various way to generate
"padding" at the page bottom:

- margin-bottom on fo:simple-page-master
- margin-bottom on fo:region-body
- Enclose all your content in an fo:block and specify:
   padding-after="2cm" padding-after.conditionality="retain"

Depends on what effect you need exactly.

HTH

On 02.05.2008 21:39:24 Vangelis Karageorgos wrote:
> Hi everybody,
> 
> there's a question we've been confronted with during our development process
> using FOP.
> Is page bottom padding possible to materialize in FOP, while constructing a
> layout with several columns and flow from one onto another?
> 
> Thanks in advance,




Jeremias Maerki


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


Re: Page bottom padding

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Vangelis Karageorgos wrote:
> Is page bottom padding possible to materialize in FOP, while constructing a
> layout with several columns and flow from one onto another?

Another wild guess: If you mean you want to have the columns
balanced, add an empty column spanning block after the content
(using span="all").

J.Pietschmann

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