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 Dennis Myrén <De...@oslokb.no> on 2005/01/07 13:43:28 UTC

Page background color

Hi.

 

I have this page with objects, some of them are positioned at strict and exact locations(they are placed in static-content), and one is a flowing object(a table in flow).

Now i try to do a simple thing, just setting the background color of the entire page.

I have only succeeded to color the background of the region-body region, where the flowing table is located.

The static content i have not succeeded to color(static-content is mapped to region-before).

Is there a way to set the background color of the entire page, regardless of whether objects are placed

in static-content or flow? 

 

One more question; the flowing table is often flowing through not only one but a sequence of pages.

The static content is repeated on every page where the table is flowing.

 

I would like not to repeat that static content, but rather have it rendered only at the first page.

 

I really appreciate help.

 

Regards,

Dennis JD Myrén

Developer

Oslo Kodebureau

Tel:      (+47) 98 00 11 92

Mail:   dennis@oslokb.no

Web:   www.oslokb.no

 


Re: Page background color

Posted by Chris Bowditch <bo...@hotmail.com>.
Dennis Myrén wrote:

<snip/>

> Is there a way to set the background color of the entire page, 
> regardless of whether objects are placed

No, you cant set background color on the entire page. But you can set it on 
region-*. So in your case, as well as setting background color on region-body 
you will need to set it on region-before too.

<snip/>

> I would like not to repeat that static content, but rather have it 
> rendered only at the first page.

This is straigt forward to achieve. You will need to create two 
fo:simple-page-master objects, one with a region-before defined and the other 
without. Then create a fo:page-sequence-master which uses defines which 
simple-page-master is used based on page-position. The fo:page-sequence then 
references the page-sequence-master. E.g.

<fo:simple-page-master master-name="first" page-width="210mm" page-height="297mm">
<fo:region-body margin-top="20mm" background-color="blue"/>
<fo:region-before region-name="firstHeader" extent="20mm" 
background-color="blue"/>
</fo:simple-page-master>

<fo:simple-page-master master-name="rest" page-width="210mm" page-height="297mm">
<fo:region-body margin-top="20mm" background-color="blue"/>
<fo:region-before region-name="restHeader" extent="20mm" background-color="blue"/>
</fo:simple-page-master>

<fo:page-sequence-master name="all">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="first" 
page-position="first"/>
<fo:conditional-page-master-reference master-reference="rest" 
page-position="rest"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>

then the page-sequence element references the page-sequence-master, e.g.

<fo:page-sequence master-reference="all">
<fo:static-content flow-name="firstHeader">
<fo:block>This will only appear on page 1</fo:block>
</fo:static-content>
<fo:flow>
<!-- your table as usual -->
</fo:flow>
</fo:page-sequence>

HTH!

Chris


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