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 nancy_b <na...@yahoo.com> on 2008/10/05 15:42:12 UTC

Background image as a footer separator

Hi guys,

I am trying to put an image as a footer separator. But the problem is that
it does not cover the whole page width (not including the margins of
course). Could you please advise me what I do wrong?

Here is the code:
<xsl:param name="footer.path" 
  select="'../scripts/images/footer.png'"/>

<xsl:template name="foot.sep.rule">
  <xsl:param name="pageclass"/>
  <xsl:param name="sequence"/>
  <xsl:param name="gentext-key"/>

  <xsl:if test="$footer.rule != 0">
      <xsl:attribute name="background-image">
      <xsl:call-template name="fo-external-image">
	<xsl:with-param name="filename" select="$footer.path"/>
      </xsl:call-template>
    </xsl:attribute>
  <!--<xsl:attribute name="background-attachment">fixed</xsl:attribute>-->
  <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  <xsl:attribute name="background-position-horizontal">left</xsl:attribute>
  <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  <xsl:attribute name="content-width">80pt</xsl:attribute>
  <xsl:attribute name="content-height">1cm</xsl:attribute>
  </xsl:if>
</xsl:template>

Thanks in advance!

-- 
View this message in context: http://www.nabble.com/Background-image-as-a-footer-separator-tp19824703p19824703.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: Background image as a footer separator

Posted by nancy_b <na...@yahoo.com>.
Hi Andreas,

Thanks for your response!

The problem with fo-external-graphic is that it does not work as a
background for a text that is placed in the footer. ;-( So frustrating...

Best wishes,
Nancy


Andreas Delmelle-2 wrote:
> 
> On Oct 5, 2008, at 15:42, nancy_b wrote:
> 
> Hi
> 
>> I am trying to put an image as a footer separator. But the problem  
>> is that
>> it does not cover the whole page width (not including the margins of
>> course). Could you please advise me what I do wrong?
> 
>> Here is the code:
>> <xsl:param name="footer.path"
>>   select="'../scripts/images/footer.png'"/>
>>
>> <xsl:template name="foot.sep.rule">
>>   <xsl:param name="pageclass"/>
>>   <xsl:param name="sequence"/>
>>   <xsl:param name="gentext-key"/>
>>
>>   <xsl:if test="$footer.rule != 0">
>>       <xsl:attribute name="background-image">
>>
> 
> Since the image is used as a background, there is no way to scale it  
> to fit the page-width during formatting. This is only possible with  
> either fo:external-graphic or fo:instream-foreign-object (to which  
> the content-height/content-width properties actually apply; not sure  
> to which element they are being added in your code)
> 
> The only two options I see are:
> - either pre-scale the 'footer.png' image, so it already has the  
> right dimensions
> - or abandon the approach of using a background-image, and try to  
> replace it by a fo:external-graphic, which allows you to use the  
> combination of 'width="100%" content-width="scale-to-fit"
> 
> 
> HTH'!
> 
> Andreas
> 
> ---------------------------------------------------------------------
> 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/Background-image-as-a-footer-separator-tp19824703p19833760.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: Background image as a footer separator

Posted by Andreas Delmelle <an...@telenet.be>.
On Oct 5, 2008, at 15:42, nancy_b wrote:

Hi

> I am trying to put an image as a footer separator. But the problem  
> is that
> it does not cover the whole page width (not including the margins of
> course). Could you please advise me what I do wrong?

> Here is the code:
> <xsl:param name="footer.path"
>   select="'../scripts/images/footer.png'"/>
>
> <xsl:template name="foot.sep.rule">
>   <xsl:param name="pageclass"/>
>   <xsl:param name="sequence"/>
>   <xsl:param name="gentext-key"/>
>
>   <xsl:if test="$footer.rule != 0">
>       <xsl:attribute name="background-image">
>

Since the image is used as a background, there is no way to scale it  
to fit the page-width during formatting. This is only possible with  
either fo:external-graphic or fo:instream-foreign-object (to which  
the content-height/content-width properties actually apply; not sure  
to which element they are being added in your code)

The only two options I see are:
- either pre-scale the 'footer.png' image, so it already has the  
right dimensions
- or abandon the approach of using a background-image, and try to  
replace it by a fo:external-graphic, which allows you to use the  
combination of 'width="100%" content-width="scale-to-fit"


HTH'!

Andreas

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