Loading ...
Sorry, an error occurred while loading the content.
 

Re: [XSL-FO] image background

Expand Messages
  • Chris Bowditch
    ... Am I right in thinking you want to overlay images on top of a background image? Currently the only place that supports background images in FOP are
    Message 1 of 3 , Sep 5, 2003
      >From: Blandine Jacolin <bljacolin@...>
      >
      >Hello,
      >
      >I want to insert in a <fo:block> an image as
      >background image.
      >In the same block, I want to insert different images
      >with absolute or relative position.
      >
      >I've tried with <fo:block-container> but nothing
      >appears in my pdf.
      >"image-background is not implemented yet"
      >I'm using FOP 0.20.5
      >

      Am I right in thinking you want to overlay images on top of a background
      image? Currently the only place that supports background images in FOP are
      fo:region-* (body, before, after, etc) Depending on your exact requirements
      you may be able to acheive what you want by setting the size of an
      appropriate region to be the size of your required background, and then use
      a table in that region to position images in the "top layer" However,
      whether or not this is satisifactory or not depends on what else you will
      need in the page.

      Chris

      _________________________________________________________________
      Express yourself with cool emoticons - download MSN Messenger today!
      http://www.msn.co.uk/messenger
    • bljacolin
      Hello Chris, I achieved what I wanted to do, overlaying 2 or more images. One image has absolute position. The second and others are relative and must overlay
      Message 2 of 3 , Sep 11, 2003
        Hello Chris,


        I achieved what I wanted to do, overlaying 2 or more images.
        One image has absolute position.
        The second and others are relative and must overlay my first image.
        Relative positions are given by the XML, and put into a variable.
        My images are gif.

        If it can help, my code is :


        <fo:root>
        <!-- LAYOUT MASTER-->
        <fo:layout-master-set>
        <fo:simple-page-master master-name="page"
        page-height="29.7cm" page-width="21cm"
        margin-top="0.2cm" margin-bottom="0.3cm"
        margin-left="2cm" margin-right="2cm">
        <fo:region-before extent="1cm"/>
        <fo:region-after extent="2cm"/>
        <fo:region-body margin-top="1cm" margin-bottom="1cm"/>
        </fo:simple-page-master>
        </fo:layout-master-set>

        <!--PAGE SEQUENCE-->
        <fo:page-sequence master-reference="page" font-family="serif"
        font-size="10pt" text-align="justify">
        <fo:static-content flow-name="xsl-region-before">
        <fo:block>MY PAGE</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after">
        <fo:block text-align="center" font-size="8pt">Page<fo:page-
        number/></fo:block>
        </fo:static-content>

        <fo:flow flow-name="xsl-region-body">
        <!-- I positionned my background image from borders
        given the absolute position.-->
        <fo:block-container position="absolute" top="250pt"
        left="10pt" height="120pt" width="210pt">
        <xsl:variable
        name="backgroundbloc1"><xsl:value-of
        select="DOCUMENT/IMAGES/IMAGE"/></xsl:variable>
        <fo:external-graphic src="file:
        {$backgroundbloc1}" position="relative" top="250pt" left="10pt"
        height="120pt" width="210pt"/>
        </fo:block-container>
        <!-- Then, I positionned other images, positions are
        given in the XML-->
        <xsl:for-each select="DOCUMENT/DRAWINGS/DRAW">
        <xsl:variable name="filename"><xsl:value-of
        select="."/></xsl:variable>
        <xsl:variable name="top"><xsl:value-of
        select="@top"/></xsl:variable>
        <xsl:variable name="left"><xsl:value-of
        select="@left"/></xsl:variable>
        <fo:block-container position="absolute"
        top="{$top}" left="{$left}" height="7pt" width="7pt">
        <fo:external-graphic src="file:{$filename}"
        position="relative" top="{$top}" left="{$left}" height="7pt"
        width="7pt"/>
        </fo:block-container>
        </xsl:for-each>
        <xsl:for-each select="DOCUMENT/DRAWINGS/DRAW2">
        <xsl:variable name="filename"><xsl:value-of
        select="."/></xsl:variable>
        <xsl:variable name="top"><xsl:value-of
        select="@top"/></xsl:variable>
        <xsl:variable name="left"><xsl:value-of
        select="@left"/></xsl:variable>
        <fo:block-container position="absolute"
        top="{$top}" left="{$left}" height="7pt" width="7pt">
        <fo:external-graphic src="file:{$filename}"
        position="relative" top="{$top}" left="{$left}" height="7pt"
        width="7pt"/>
        </fo:block-container>
        </xsl:for-each>
        <xsl:apply-templates select="DOCUMENT"/>
        </fo:flow>
        </fo:page-sequence>
        </fo:root>




        --- In XSL-FO@yahoogroups.com, "Chris Bowditch"
        <bowditch_chris@h...> wrote:
        > >From: Blandine Jacolin <bljacolin@y...>
        > >
        > >Hello,
        > >
        > >I want to insert in a <fo:block> an image as
        > >background image.
        > >In the same block, I want to insert different images
        > >with absolute or relative position.
        > >
        > >I've tried with <fo:block-container> but nothing
        > >appears in my pdf.
        > >"image-background is not implemented yet"
        > >I'm using FOP 0.20.5
        > >
        >
        > Am I right in thinking you want to overlay images on top of a
        background
        > image? Currently the only place that supports background images in
        FOP are
        > fo:region-* (body, before, after, etc) Depending on your exact
        requirements
        > you may be able to acheive what you want by setting the size of an
        > appropriate region to be the size of your required background, and
        then use
        > a table in that region to position images in the "top layer"
        However,
        > whether or not this is satisifactory or not depends on what else
        you will
        > need in the page.
        >
        > Chris
        >
        > _________________________________________________________________
        > Express yourself with cool emoticons - download MSN Messenger
        today!
        > http://www.msn.co.uk/messenger
      Your message has been successfully submitted and would be delivered to recipients shortly.