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

Fitting a bitmap as background image

Expand Messages
  • raymundo2104 <raymundo2104@yahoo.com.au>
    Anyone, I have a 23.75cm x 15.5cm bitmap that I want to become the background image for fo:region-body with exactly the same dimension. FOP 0.20.4 rendered
    Message 1 of 3 , Feb 3, 2003
    • 0 Attachment
      Anyone,

      I have a 23.75cm x 15.5cm bitmap that I want to become the background
      image for "fo:region-body" with exactly the same dimension. FOP
      0.20.4 rendered only roughly 90% of the bitmap -- clipping the right
      and bottom parts of the image (note that I need to retain the
      symmetry of the design in the bitmap!). I copied part of the code
      below. Any help on solving this will be appreciated.
      Thanks and regards,

      Enrico Raymundo, Senior Applications Developer
      NetImpact Publishing
      enrico@...


      <fo:simple-page-master margin-bottom="0cm" margin-left="0cm" margin-
      right="0cm" margin-top="0cm" page-height="21.5cm" page-width="31cm"
      master-name="spmFirst">
      <fo:region-before
      region-name="xsl-region-before"
      extent="3cm" />
      <fo:region-after
      region-name="xsl-region-after"
      extent="3cm" />
      <fo:region-start
      region-name="xsl-region-start"
      extent="7.25cm" />
      <fo:region-end
      region-name="xsl-region-end"
      extent="0cm" />
      <fo:region-body
      margin-top="3cm"
      margin-bottom="3cm"
      margin-left="7.25cm"
      margin-right="0cm"
      region-name="xsl-region-body"
      background-image="e:\demo\region-body_cam.bmp" />
      </fo:simple-page-master>
    • Douglas Lovell
      Pages 229-231 of the XSL Formatting Objects Developer s Handbook describe sizing and scaling of graphics. Pages 236-7 discuss background image positioning and
      Message 2 of 3 , Feb 4, 2003
      • 0 Attachment
        Pages 229-231 of the XSL Formatting Objects Developer's Handbook describe
        sizing and scaling of graphics. Pages 236-7 discuss background image
        positioning and repeat. You can center a background image using
        background-position-horizontal/vertical. Don't see a way to scale the bg
        image.

        The best I was able to do was to place the graphic in the static content of
        the page, in a block with width fixed to the width of the page, in an
        external-graphic with content scaled to fit. Here's what I came up with:

        <fo:page-sequence master-reference="spmFirst">
        <fo:static-content
        flow-name="xsl-region-start">
        <fo:block
        width="31cm">
        <fo:external-graphic
        content-width="scale-to-fit"
        src="e:\demo\region-body_cam.bmp"/>
        </fo:block>
        </fo:static-content>
        <fo:flow
        flow-name="xsl-region-body">
        <xsl:apply-templates/>
        </fo:flow>
        </fo:page-sequence>

        I chose the region-start because that is the region in the upper-left
        corner. Presumably, all of this could appear in any region, including your
        zero sized region-end, if it was in an absolutely positioned
        block-container.

        Tested with Antenna House. Have not tested FOP 0.20.4.

        Douglas Lovell




        "raymundo2104
        <raymundo2104@yah To: XSL-FO@yahoogroups.com
        oo.com.au>" cc:
        <raymundo2104 Subject: [XSL-FO] Fitting a bitmap as background image

        02/03/2003 09:59
        PM
        Please respond to
        XSL-FO





        Anyone,

        I have a 23.75cm x 15.5cm bitmap that I want to become the background
        image for "fo:region-body" with exactly the same dimension. FOP
        0.20.4 rendered only roughly 90% of the bitmap -- clipping the right
        and bottom parts of the image (note that I need to retain the
        symmetry of the design in the bitmap!). I copied part of the code
        below. Any help on solving this will be appreciated.
        Thanks and regards,

        Enrico Raymundo, Senior Applications Developer
        NetImpact Publishing
        enrico@...


        <fo:simple-page-master margin-bottom="0cm" margin-left="0cm" margin-
        right="0cm" margin-top="0cm" page-height="21.5cm" page-width="31cm"
        master-name="spmFirst">
        <fo:region-before
        region-name="xsl-region-before"
        extent="3cm" />
        <fo:region-after
        region-name="xsl-region-after"
        extent="3cm" />
        <fo:region-start
        region-name="xsl-region-start"
        extent="7.25cm" />
        <fo:region-end
        region-name="xsl-region-end"
        extent="0cm" />
        <fo:region-body
        margin-top="3cm"
        margin-bottom="3cm"
        margin-left="7.25cm"
        margin-right="0cm"
        region-name="xsl-region-body"
        background-image="e:\demo\region-body_cam.bmp" />
        </fo:simple-page-master>



        To unsubscribe from this group, send an email to:
        XSL-FO-unsubscribe@egroups.com



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • raymundo2104 <raymundo2104@yahoo.com.au>
        Hi Douglas, Thanks for your help (will be getting the handbook). I also tried the original XSL-FO code using RenderX 3.14 eval and it worked. As mentioned
        Message 3 of 3 , Feb 4, 2003
        • 0 Attachment
          Hi Douglas,

          Thanks for your help (will be getting the handbook). I also tried
          the original XSL-FO code using RenderX 3.14 eval and it worked. As
          mentioned FOP 0.20.4 renders only roughly 90% of the image.

          regards,

          Enrico

          --- In XSL-FO@yahoogroups.com, Douglas Lovell <dcl@u...> wrote:
          >
          >
          >
          >
          > Pages 229-231 of the XSL Formatting Objects Developer's Handbook
          describe
          > sizing and scaling of graphics. Pages 236-7 discuss background
          image
          > positioning and repeat. You can center a background image using
          > background-position-horizontal/vertical. Don't see a way to scale
          the bg
          > image.
          >
          > The best I was able to do was to place the graphic in the static
          content of
          > the page, in a block with width fixed to the width of the page, in
          an
          > external-graphic with content scaled to fit. Here's what I came up
          with:
          >
          > <fo:page-sequence master-reference="spmFirst">
          > <fo:static-content
          > flow-name="xsl-region-start">
          > <fo:block
          > width="31cm">
          > <fo:external-graphic
          > content-width="scale-to-fit"
          > src="e:\demo\region-body_cam.bmp"/>
          > </fo:block>
          > </fo:static-content>
          > <fo:flow
          > flow-name="xsl-region-body">
          > <xsl:apply-templates/>
          > </fo:flow>
          > </fo:page-sequence>
          >
          > I chose the region-start because that is the region in the upper-
          left
          > corner. Presumably, all of this could appear in any region,
          including your
          > zero sized region-end, if it was in an absolutely positioned
          > block-container.
          >
          > Tested with Antenna House. Have not tested FOP 0.20.4.
          >
          > Douglas Lovell
          >
          >
          >
          >

          > "raymundo2104

          > <raymundo2104@yah To: XSL-
          FO@yahoogroups.com

          > oo.com.au>"
          cc:

          > <raymundo2104 Subject: [XSL-FO]
          Fitting a bitmap as background image
          >

          > 02/03/2003
          09:59

          >
          PM

          > Please respond
          to

          > XSL-
          FO

          >

          >
          >
          >
          >
          > Anyone,
          >
          > I have a 23.75cm x 15.5cm bitmap that I want to become the
          background
          > image for "fo:region-body" with exactly the same dimension. FOP
          > 0.20.4 rendered only roughly 90% of the bitmap -- clipping the right
          > and bottom parts of the image (note that I need to retain the
          > symmetry of the design in the bitmap!). I copied part of the code
          > below. Any help on solving this will be appreciated.
          > Thanks and regards,
          >
          > Enrico Raymundo, Senior Applications Developer
          > NetImpact Publishing
          > enrico@n...
          >
          >
          > <fo:simple-page-master margin-bottom="0cm" margin-left="0cm" margin-
          > right="0cm" margin-top="0cm" page-height="21.5cm" page-width="31cm"
          > master-name="spmFirst">
          > <fo:region-before
          > region-name="xsl-region-before"
          > extent="3cm" />
          > <fo:region-after
          > region-name="xsl-region-after"
          > extent="3cm" />
          > <fo:region-start
          > region-name="xsl-region-start"
          > extent="7.25cm" />
          > <fo:region-end
          > region-name="xsl-region-end"
          > extent="0cm" />
          > <fo:region-body
          > margin-top="3cm"
          > margin-bottom="3cm"
          > margin-left="7.25cm"
          > margin-right="0cm"
          > region-name="xsl-region-body"
          > background-image="e:\demo\region-
          body_cam.bmp" />
          > </fo:simple-page-master>
          >
          >
          >
          > To unsubscribe from this group, send an email to:
          > XSL-FO-unsubscribe@egroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
        Your message has been successfully submitted and would be delivered to recipients shortly.