Many thanks, it's fun now

regards,

Debasish


On 8/29/07, Pascal Sancho <[EMAIL PROTECTED]> wrote:
>
> Well, try this and you can replace texts like "background in region xxx"
> with any image.
>
> You just need to tune left, top, width, and height properties of the
> fo:block-container.
>
> Enjoy!
>
> Pascal
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo=" http://www.w3.org/1999/XSL/Format"; xmlns:set="
> http://exslt.org/sets"; xmlns:xdt=" http://www.w3.org/2005/xpath-datatypes";
> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"; 
> xmlns:xs="http://www.w3.org/2001/XMLSchema
> ">
> <fo:layout-master-set>
>    <fo:simple-page-master page-width="210mm" page-height="297mm"
> master-name="document">
>      <fo:region-body margin="20mm"/>
>      <fo:region-before extent="3cm" background-color="#ffcccc"/>
>      <fo:region-after extent="3cm" background-color="#ccffcc"/>
>      <fo:region-start extent="3cm" background-color="#ccccff"/>
>      <fo:region-end extent="3cm" background-color="#ffccff"/>
>    </fo:simple-page-master>
> </fo:layout-master-set>
>
> <fo:page-sequence master-reference="document" language="fr">
>    <fo:static-content flow-name="xsl-region-before" color="#ff0000">
>      <fo:block-container absolute-position="absolute"
>        left="10mm" top="40mm" width="100mm" height="100mm"
>        border="solid #ff0000 1pt">
>        <fo:block>background in region before</fo:block>
>      </fo:block-container>
>      <fo:block>region-before</fo:block>
>    </fo:static-content>
>
>    <fo:static-content flow-name="xsl-region-after" color="#00ff00">
>      <fo:block-container absolute-position="absolute"
>        left="20mm" top="-217mm" width="100mm" height="100mm"
>        border="solid #00ff00 1pt">
>        <fo:block>background in region after</fo:block>
>      </fo:block-container>
>      <fo:block>region-after</fo:block>
>    </fo:static-content>
>
>    <fo:static-content flow-name="xsl-region-start" color="#0000ff">
>      <!-- the best static region for background,
>           regarding the precedence default values -->
>      <fo:block-container absolute-position="absolute"
>        left="60mm" top="60mm" width="100mm" height="100mm"
>        border="solid #0000ff 1pt">
>        <fo:block>background in region start</fo:block>
>      </fo:block-container>
>      <fo:block>region-start</fo:block>
>    </fo:static-content>
>
>    <fo:static-content flow-name="xsl-region-end" color="#ff00ff">
>      <fo:block-container absolute-position="absolute"
>        left="-110mm" top="70mm" width="100mm" height="100mm"
>        border="solid #ff00ff 1pt">
>        <fo:block>background in region end</fo:block>
>      </fo:block-container>
>      <fo:block>region-end</fo:block>
>    </fo:static-content>
>
>    <fo:flow flow-name="xsl-region-body" overflow="visible">
>      <fo:block-container absolute-position="absolute" width="100%"
> height="100%"
>        color="#00ffff">
>        <fo:block>region-body</fo:block>
>      </fo:block-container>
>      <fo:block-container absolute-position="absolute" width="100%"
> height="100%"
>        color="#00ffff" display-align="after">
>        <fo:block>region-body</fo:block>
>      </fo:block-container>
>      <fo:block-container absolute-position="absolute" width="100%"
> height="100%"
>        color="#00ffff" text-align="end">
>        <fo:block>region-body</fo:block>
>      </fo:block-container>
>      <fo:block-container absolute-position="absolute" width="100%"
> height="100%"
>        color="#00ffff" text-align="end" display-align="after">
>        <fo:block>region-body</fo:block>
>      </fo:block-container>
>      <!-- normal flow here-->
>    </fo:flow>
> </fo:page-sequence>
> </fo:root>
>
> > -----Message d'origine-----
> > De : Debasish Jana [mailto:[EMAIL PROTECTED]
> > Envoyé : mercredi 29 août 2007 11:03
> >
> > Hi Pascal:
> >
> > Many thanks. I tried to add a block-container with
> > fo:instream-forein-object to take up the SVG directly
> > embedded inside the body. However, in order to have the image
> > appear on every page, I need to define it within a static
> > content. But, xsl-region-body is appearing within fo:flow and
> > I cannot put xsl-region-body both as a static content as well
> > as fo:flow within fo:page-sequence. My requirement is to
> > embed the image that appears on every page of the body span.
> > Please throw some more light. Thanks again in advance,
> >
> > warm regards,
> >
> > Debasish Jana
> >
> > On 8/29/07, Pascal Sancho <[EMAIL PROTECTED]> wrote:
> >
> >       Hi DJ,
> >
> >       In order to use any image as page background (either
> > with fo:external-graphic or fo:instream-foreign-object), you
> > can insert it directly in a static region, using a
> > block-container in absolute position.
> >
> >       With FOP 0.9x, the body region is drawn at the top
> > level, therefore static-regions can be used as background for
> > body region.
> >
> >       By setting your background in the start-region, the
> > (0,0) is the top left corner of your sheet, minus
> > fo:simple-page-master margins.
> >
> >       In other regions, you can use negative coordinates to
> > put your image else where, depending on extent properties.
> >
> >       HTH,
> >
> >       Pascal
> >
> >       > -----Message d'origine-----
> >       > De : Debasish Jana [mailto: [EMAIL PROTECTED] ]
> >       > Envoyé : mercredi 29 août 2007 10:03
> >       >
> >       > Hi:
> >       >
> >       > I need to put a SVG image to appear on every page in
> >       > region-body. I would like to create the SVG in the same xsl
> >       > file and use it as background image within region-body so as
> >       > to appear on every page. Placing the SVG as an external file
> >       > works. However, putting the SVG as embedded content does not
> >       > work. The XSL code used is given below
> >       >
> >       > Please help.
> >       >
> >       > warm regards,
> >       >
> >       > Debasish Jana
> >       > -----
> >       >
> >       > Case I (When SVG file is used as external file, this works)
> >       >
> >       > <?xml version="1.0 " encoding="ISO-8859-1"?> <xsl:stylesheet
> >       > version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform ">
> >       >
> >       > <xsl:template name="PageBG">
> >       > url(E:\DJANA\Test\PageBG.svg)
> >       > </xsl:template>
> >       >
> >       > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format ">
> >       >     <fo:layout-master-set>
> >       >         <fo:simple-page-master
> > master-name="PageMasterPortrait"
> >       >         page-height="11in" page-width=" 8.5in"
> >       >         margin-top="0in" margin-left=" 0.0in"
> >       > margin-right="0.0in" margin-bottom="0.0in"
> >       >         white-space-collapse="false"
> >       > white-space-treatment="preserve"
> >       > linefeed-treatment="preserve" line-height="82%"
> >       >         >
> >       >             <fo:region-body margin=" 0.4in"
> >       > background-color="#dd0000" >
> >       >                                 <xsl:attribute
> >       > name="background-image"><xsl:call-template
> >       > name="PageBG"/></xsl:attribute>
> >       >             </fo:region-body>
> >       > .....
> >       >
> >       > Case II (When SVG content is directly embeded in the xsl
> >       > file, this does not work, says background iamge not
> > available)
> >       >
> >       >
> >       > <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet
> >       > version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform ">
> >       >
> >       > <xsl:template name="PageBG">
> >       > <svg xmlns="http://www.w3.org/2000/svg"; id="PageBGSVG"
> >       > width=" 7.7in" height="10.2in" viewBox="0 0 0 0"> .....
> >       >
> >       > </svg></xsl:template>
> >       >
> >       > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format ">
> >       >     <fo:layout-master-set>
> >       >         <fo:simple-page-master
> > master-name="PageMasterPortrait"
> >       >         page-height="11in" page-width=" 8.5in"
> >       >         margin-top="0in" margin-left=" 0.0in"
> >       > margin-right="0.0in" margin-bottom="0.0in"
> >       >         white-space-collapse="false"
> >       > white-space-treatment="preserve"
> >       > linefeed-treatment="preserve" line-height="82%"
> >       >         >
> >       >             <fo:region-body margin=" 0.4in"
> >       > background-color="#dd0000" >
> >       >                                 <xsl:attribute
> >       > name="background-image"><xsl:call-template
> >       > name="PageBG"/></xsl:attribute>
> >       >             </fo:region-body>
> >       > .....
> >
> >
> >
> > ---------------------------------------------------------------------
> >       To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> >       For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to