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 Debasish Jana <de...@gmail.com> on 2007/08/16 10:00:48 UTC

SVG Gradient in FO

Hi:
I am trying to use liner gradient effect in fo:body area as the
following code. The problem is that the linear gradient efefct with
two colors is not filling the entire body area within the page. Am I
doing anything wrong? Any clue? Can you refer to some samples using
linear gradient with multiple colors that fills up the entire page
(including header, footer, left, right, body) as background? I would
like to embed the svg as a instream-foreign-object and do not want to
use an external svg file.

Appreciate your help.

warm regards,

Debasish Jana

<fo:flow flow-name="xsl-region-body">
 <fo:block-container position="absolute"  reference-orientation="0">
 <fo:block  font-size="0mm">
 <fo:instream-foreign-object content-width="7.7in"  >
 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0">
<defs>
 <linearGradient id="grad1">
 <stop offset="0%" stop-color="#F60"/>
<stop offset="100%" stop-color="#FF6"/>
</linearGradient>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="url(#grad1)" />
</svg>
</fo:instream-foreign-object>
</fo:block>
</fo:block-container>
....
</fo:flow>

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


Re: SVG Gradient in FO

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Debasish Jana wrote:
> I am trying to use liner gradient effect in fo:body area as the
> following code. The problem is that the linear gradient efefct with
> two colors is not filling the entire body area within the page.

The most likely cause is that the image is too small.
What's the body area width&height?

> Any clue? Can you refer to some samples using
> linear gradient with multiple colors that fills up the entire page
> (including header, footer, left, right, body) as background?

If you want an image as background, you should better use
a background image on the region instead of embedding a
block container with the image into the normal flow.
If you want to have all regions handled, you could provide
matching background images for each region, or if this seems
to be too difficult, you could use a single background image
on e.g. start-region, which is defined to span the whole page
(and overlaps all other regions).

J.Pietschmann

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