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 George Tsopouridis <gt...@gmail.com> on 2008/10/08 16:01:37 UTC

Re: Page bottom padding

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: 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