[xsl] Re: [FO] Background image on whole page

Subject: [xsl] Re: [FO] Background image on whole page
From: Vincent Hennebert <vincent.hennebert@xxxxxxxxxxxxxxxx>
Date: Thu, 10 Jan 2008 11:34:01 +0000
>> Each region can have its own background, so you can use 
>> background-image= on <region-body>.
>> To get "the whole page" you will need to have the body region extend 
>> to the page dimensions, which is not really desirable for top and 
>> bottom margins.  
> Yes, I noticed.
>> An alternative is to parcel out a whole page background into bits 
>> that are set as the backgrounds of the respective perimeter regions 
>> and body region.
> <sigh> I was hoping you wouldn't say that. Oh well. I guess I will chalk 
> that up as something else XSLFO can't do.

Well you can also use an absolutely positioned block-container with 
a background-image; for example:
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
        <fo:simple-page-master master-name="page"
          page-height="29.7cm" page-width="21cm"
          margin-top="2cm" margin-bottom="2cm"
          margin-left="3cm" margin-right="3cm">
      <fo:page-sequence master-reference="page">
        <fo:flow flow-name="xsl-region-body">
          <fo:block-container absolute-position="absolute"
            top="-2cm" left="-3cm" width="21cm" height="29.7cm"
            The document starts here...


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

Current Thread