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 Antonio Fiol <fi...@w3ping.com> on 2002/07/11 17:58:22 UTC

Gradient support

Hello.

This must be a FAQ, but I have not found anything on it.

Are gradients supported?

Here's the relevant FO code:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="stdpage" page-width="210mm" 
page-height="297mm">
      <fo:region-before extent="1cm"/>
      <fo:region-body margin-top="3cm" margin-left="2cm" 
margin-right="2cm" margin-bottom="3cm"/>
      <fo:region-after extent="1cm"/>
    </fo:simple-page-master>
    <fo:simple-page-master master-name="firstpage" page-width="210mm" 
page-height="297mm">
      <fo:region-body margin-top="3cm" margin-left="2cm" 
margin-right="2cm" margin-bottom="3cm"/>
    </fo:simple-page-master>
    <fo:page-sequence-master master-name="page-sequence-master">
      <fo:single-page-master-reference master-reference="firstpage"/>
      <fo:repeatable-page-master-reference master-reference="stdpage"/>
    </fo:page-sequence-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="page-sequence-master">
    <fo:static-content flow-name="xsl-region-before">
      <fo:block text-align="center" border-after-style="solid" 
border-after-color="#CCCCCC" border-after-width="0.5pt">Graphic 
example</fo:block>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-after">
      <fo:block text-align="center">
Page             <fo:page-number/>
      </fo:block>
    </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
<fo:instream-foreign-object>
<svg width="17cm" height="10cm" viewBox="0 0 4320 3240" 
xmlns="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink" >
<linearGradient id="backcloth" gradientTransform="rotate(15)" > <stop 
offset="5%" style="stop-color:#00C"/> <stop offset="95%" 
style="stop-color:#004"/> </linearGradient>
 <g style="fill:url(#backcloth); stroke:black; stroke-width:15" 
shape-rendering="crispEdges" >
  <rect x="40" y="40" width="4240" height="3160"  />
 </g>
</svg>
</fo:instream-foreign-object>
    </fo:flow>
  </fo:page-sequence>
</fo:root>


I get NO ERROR, and the PDF document contains a BLACK rectangle instead 
of a gradient-painted one.

Thank you very much for any hint.

I am using fop 0.20.3.


Antonio Fiol


Re: Gradient support

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Antonio Fiol wrote:
> Are gradients supported?

No. Wait for the next maintenance release.

J.Pietschmann