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 Abel Braaksma <ab...@xs4all.nl> on 2012/12/19 18:04:52 UTC

Simple SVG path doesn't render at all with FOP 1.0

Hi List,

I'm trying to get an SVG logo on a pageusing fo:instream-foreign-object,
but all I got was total nothingness. So I trimmed down the example and
after some experimenting, I got it working with svg:rect, but as soon as
a svg:path turned up, it didn't get rendered.

Does anybody know of this issue? Or am I simply missing something? I'm
using FOP 1.0 with Batik 1.7.From a long time ago I remember I had
something similar and that I needed to setup a viewport or coordinates
translation or something, but I can't find the example I had back then.

This is a rectangle drawn by svg:path, which doesn't work:

   <svg xmlns="http://www.w3.org/2000/svg"
      width="40px" height="40px">
      <path style="stroke:black; stroke-width:2; fill:red"
         d="M 20 390 L 80 390 L 80 410 L 20 410 Z" />
   </svg>

Any helpis appreciated,

Thanks,
Abel Braaksma

Re: Simple SVG path doesn't render at all with FOP 1.0

Posted by Sergiu Dumitriu <se...@gmail.com>.
On 12/19/2012 12:04 PM, Abel Braaksma wrote:
> Hi List,
> 
> I'm trying to get an SVG logo on a pageusing fo:instream-foreign-object,
> but all I got was total nothingness. So I trimmed down the example and
> after some experimenting, I got it working with svg:rect, but as soon as
> a svg:path turned up, it didn't get rendered.
> 
> Does anybody know of this issue? Or am I simply missing something? I'm
> using FOP 1.0 with Batik 1.7.From a long time ago I remember I had
> something similar and that I needed to setup a viewport or coordinates
> translation or something, but I can't find the example I had back then.
> 
> This is a rectangle drawn by svg:path, which doesn't work:
> 
>    <svg xmlns="http://www.w3.org/2000/svg"
>       width="40px" height="40px">
>       <path style="stroke:black; stroke-width:2; fill:red"
>          d="M 20 390 L 80 390 L 80 410 L 20 410 Z" />
>    </svg>
> 
> Any helpis appreciated,
> 
> Thanks,
> Abel Braaksma

The problem is in the SVG content. Since you specify a width and a
height, but not a viewbox, the path is drawn, but outside the visible
area. If you increase the height of the SVG to 500, you'll see the image
somewhere very low.

So, make sure you're drawing inside the area that's actually displayed.

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