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 Denis Balazuc <De...@trader.com> on 2002/07/17 16:37:56 UTC

PDF, before and body

Hi there

I'm trying to generating reports using FOP, and output them as PDF format.
I want to have a header on each page (region-before) and pages with the
content of the report (region-body).

I seem to be able to do this pretty well, however, the region-body content
is drawn over the region-before in the final PDF.
I have tried various options (like extent="Ncm"), space-before and such, but
nothing seems to do the job correctly.

The attached picture shows the 2 header images overlapping the actual
content of the region-body.
(region-before has a blue border, and each entry from the source XML has a
grey border in the region-body. The page-body is made of lots of
grey-bordered fo:block(s) )

Here's my page settings : (I guess it's pretty straight forward, I'm a
newbie ;-))
   <fo:layout-master-set>

      <fo:simple-page-master
        master-name="showroom-report-page"
        page-height="29.7cm"
        page-width="21cm">

          <fo:region-body
              region-name="page-body"/>

          <fo:region-before
              region-name="page-before"
              extent="4cm"/> <!-- Without this, the FOP renderer does not
render the static-content because of a lack of space -->

          <fo:region-after
              region-name="page-after"/>

      </fo:simple-page-master>
    </fo:layout-master-set>

    <fo:page-sequence master-reference="showroom-report-page">
      <fo:title>
        <xsl:value-of select="./showroom/description"/>
      </fo:title>

      <!-- Display the showroom header on top of each page -->
      <fo:static-content flow-name="page-before">
            <xsl:apply-templates select="./showroom"/>
      </fo:static-content>

      <!-- Page body content is made of items -->
      <fo:flow flow-name="page-body">
            <xsl:apply-templates select="./item"/>
      </fo:flow>
    </fo:page-sequence>


Thanks for any kind of help !
Best regards

Denis Balazuc


Re: PDF, before and body

Posted by Denis Balazuc <De...@trader.com>.
Hi all 

Thanks for all your quick replies ! adding margins works like a charm ;-)

I was wrongly assuming that page regions could not overlap each other...
I learn a new thing everyday ;-)

Thanks again to all.

Denis



> Hi Denis,
> 
> Try to include margins to the fo:region-body. Something like:
> 
> <fo:region-body margin-bottom="4cm"
>                       margin-top="4cm">
>       </fo:region-body>
> 



Re: PDF, before and body

Posted by Harm Kok <h....@diderottrack.nl>.
Hi Denis,

Try to include margins to the fo:region-body. Something like:

<fo:region-body margin-bottom="4cm"
                      margin-top="4cm">
      </fo:region-body>

Escpecially the margin-top will be important for you.

Hope this helps,

Harm


Denis Balazuc wrote:

>Hi there
>
>I'm trying to generating reports using FOP, and output them as PDF format.
>I want to have a header on each page (region-before) and pages with the
>content of the report (region-body).
>
>I seem to be able to do this pretty well, however, the region-body content
>is drawn over the region-before in the final PDF.
>I have tried various options (like extent="Ncm"), space-before and such, but
>nothing seems to do the job correctly.
>
>The attached picture shows the 2 header images overlapping the actual
>content of the region-body.
>(region-before has a blue border, and each entry from the source XML has a
>grey border in the region-body. The page-body is made of lots of
>grey-bordered fo:block(s) )
>
>Here's my page settings : (I guess it's pretty straight forward, I'm a
>newbie ;-))
>   <fo:layout-master-set>
>
>      <fo:simple-page-master
>        master-name="showroom-report-page"
>        page-height="29.7cm"
>        page-width="21cm">
>
>          <fo:region-body
>              region-name="page-body"/>
>
>          <fo:region-before
>              region-name="page-before"
>              extent="4cm"/> <!-- Without this, the FOP renderer does not
>render the static-content because of a lack of space -->
>
>          <fo:region-after
>              region-name="page-after"/>
>
>      </fo:simple-page-master>
>    </fo:layout-master-set>
>
>    <fo:page-sequence master-reference="showroom-report-page">
>      <fo:title>
>        <xsl:value-of select="./showroom/description"/>
>      </fo:title>
>
>      <!-- Display the showroom header on top of each page -->
>      <fo:static-content flow-name="page-before">
>            <xsl:apply-templates select="./showroom"/>
>      </fo:static-content>
>
>      <!-- Page body content is made of items -->
>      <fo:flow flow-name="page-body">
>            <xsl:apply-templates select="./item"/>
>      </fo:flow>
>    </fo:page-sequence>
>
>
>Thanks for any kind of help !
>Best regards
>
>Denis Balazuc
>
>  
>



Re: PDF, before and body

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Denis Balazuc wrote:

> I'm trying to generating reports using FOP, and output them as PDF format.
> I want to have a header on each page (region-before) and pages with the
> content of the report (region-body).
> 
> I seem to be able to do this pretty well, however, the region-body content
> is drawn over the region-before in the final PDF.
> I have tried various options (like extent="Ncm"), space-before and such, but
> nothing seems to do the job correctly.

Just specify appropriate margin on fo:region-body, e.g.

<fo:region-body margin-top="4cm"
    region-name="page-body"/>

-- 
Oleg Tkachenko
Multiconn International, Israel