Setting background image in fo and html output

View: New views
5 Messages — Rating Filter:   Alert me  

Setting background image in fo and html output

by Antti Karanta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



                           Hi!

   I looked at "Docbook xsl - a complete guide" and googled some, but could  
not find anything on setting the page background image in fo (and html)  
transformations. Any hints how I could do this?



          -Antti-



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: Setting background image in fo and html output

by AlChuck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Antti,

Did you see this post titled "Background image in header?"

http://www.nabble.com/Background-image-in-header-to10780826.html#a10784847

Antti Karanta wrote:

                           Hi!

   I looked at "Docbook xsl - a complete guide" and googled some, but could  
not find anything on setting the page background image in fo (and html)  
transformations. Any hints how I could do this?



          -Antti-



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

Re: Setting background image in fo and html output

by Antti Karanta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



          Hi Alan!


On Wed, 06 Feb 2008 20:13:08 +0200, AlChuck <alan.oehler@xxx> wrote:

> Did you see this post titled "Background image in header?"
>
> http://www.nabble.com/Background-image-in-header-to10780826.html#a10784847

   No, I didn't, but I have no problem w/ header / footer background  
images. They're working fine. What I now need is a page background image.

   I dug aound a bit and it seems that to support background images I need  
to use custom page masters. This would not be necessary if  
fo/pagesetup.xsl (template setup.pagemasters) would e.g. have an attribute  
set or call a user overrideable template I could use to insert these  
attributes into fo:region-body (in a fo:simple-page-master):

background-image="url(logogray.png)"
background-position-horizontal="center"
background-position-vertical="center"
background-repeat="no-repeat"



   Should I file an enhancement request?

   Or did I miss something and there actually is a way to influence the  
default page masters?



        .::Antti::.



> Antti Karanta wrote:
>>
>>
>>
>>                            Hi!
>>
>>    I looked at "Docbook xsl - a complete guide" and googled some, but
>> could
>> not find anything on setting the page background image in fo (and html)
>> transformations. Any hints how I could do this?
>>
>>
>>
>>           -Antti-
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-apps-unsubscribe@...
>> For additional commands, e-mail: docbook-apps-help@...
>>
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: Setting background image in fo and html output

by AlChuck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is a way, it's described in Bob Stayton's DocBook XSL - The Complete Guide:

http://www.sagehill.net/docbookxsl/PageDesign.html

I haven't tried it yet for the body part of the page masters but it should work the same as with the area-before and area-after sections.

I'm curious, if you didn't do the header and footer background images as described in this chapter, how did you do it?


Antti Karanta wrote:
   No, I didn't, but I have no problem w/ header / footer background  
images. They're working fine. What I now need is a page background image.

   I dug aound a bit and it seems that to support background images I need  
to use custom page masters. This would not be necessary if  
fo/pagesetup.xsl (template setup.pagemasters) would e.g. have an attribute  
set or call a user overrideable template I could use to insert these  
attributes into fo:region-body (in a fo:simple-page-master):

background-image="url(logogray.png)"
background-position-horizontal="center"
background-position-vertical="center"
background-repeat="no-repeat"

   Should I file an enhancement request?

   Or did I miss something and there actually is a way to influence the  
default page masters?

        .::Antti::.

Re: Setting background image in fo and html output

by Antti Karanta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, 07 Feb 2008 18:33:26 +0200, AlChuck <alan.oehler@xxx> wrote:

> There is a way, it's described in Bob Stayton's DocBook XSL - The  
> Complete Guide:
>
> http://www.sagehill.net/docbookxsl/PageDesign.html

   I've read this. I looked at it again, and I still could not figure out a  
way to use background images short of using custom page masters. It seems  
like a lot of hassle just to get the background image in (but I guess  
that's what I'll have to do).

   If I missed something and it's easier than this, please prove me wrong  
and you'll have my gratitude. = )


> I haven't tried it yet for the body part of the page masters but it  
> should
> work the same as with the area-before and area-after sections.
>
> I'm curious, if you didn't do the header and footer background images as
> described in this chapter, how did you do it?

   I did follow the instructions in  
http://www.sagehill.net/docbookxsl/PrintHeaders.html


   I would like the page background images be as modularly overrideable as  
headers and footers are. For example, if in fo/pagesetup.xsl every page  
master had a call to user overridable template (that is by default empty)  
this would be easy. E.g.



     <fo:simple-page-master master-name="blank"
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
                            margin-bottom="{$page.margin.bottom}"
                            margin-left="{$margin.left.outer}"
                            margin-right="{$page.margin.inner}">
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">blank</xsl:with-param>
         </xsl:call-template>
       </xsl:if>
       <fo:region-body display-align="center"
                       margin-bottom="{$body.margin.bottom}"
                       margin-top="{$body.margin.top}">
         <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
           <xsl:attribute name="region-name">blank-body</xsl:attribute>
         </xsl:if>

<!-- if this was actually here it would be easy to insert background  
images: -->
<!-- The same call would naturally be made in region-before and  
region-after -->
<xsl:call-template name="user.page.region">
   <xsl:with-param name="master-name" select="'blank'"/>
   <xsl:with-param name="location" select="'region-body'"/>
</xsl:call-template>
<!-- end my insertion -->

       </fo:region-body>
       <fo:region-before region-name="xsl-region-before-blank"
                         extent="{$region.before.extent}"
                         display-align="before"/>
       <fo:region-after region-name="xsl-region-after-blank"
                        extent="{$region.after.extent}"
                         display-align="after"/>
     </fo:simple-page-master>

...
<!-- default implementation of this template -->
<xsl:template name="user.page.region"/>


   Of course I can modify fo/pagesetup.xsl myself, but that does not sound  
like such a good idea from maintenance point of view...



           .::AK::.


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...