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 fo...@mechner.com on 2002/08/15 20:01:00 UTC

External graphic svg clipping problem

Hi,

I'm including an SVG file in a simple .fo file (I'm not using XSL,
just editing it by hand to get the template set up looking the way I
want) and using FOP to process it. When I view the file, using either
the FOP viewer or rendering to PDF and using Acrobat reader, only the
upper left corner of the SVG image appears (about 1 inch square). The
SVG file is created with JFreeChart, and is ok (I can view it using
batik).

I've played around with setting different values for the
external-graphic height, width, content-height, content-width, etc.
but to no avail. Setting the height and width seems to do something,
as the enclosing block is made larger, but the same small bit of the
image is all that appears. Here's the code snippet:

  <fo:block padding="6pt" background-color="lightblue">
    <fo:external-graphic src="file:test.svg" height="3in" width="6in"
                       content-height="3in" content-width="6in" />
  </fo:block>

Help!

I saw in the archive someone suggested supplying a
ChartRenderingObject to the draw method in JFreeChart in the context
of embed-foreign-object, but that didn't change anything.

Any help would be much appreciated!!

Thanks,
-David Mechner


External graphic svg clipping problem

Posted by fo...@mechner.com.
Hi,

I'm including an SVG file in a simple .fo file (I'm not using XSL,
just editing it by hand to get the template set up looking the way I
want) and using FOP to process it. When I view the file, using either
the FOP viewer or rendering to PDF and using Acrobat reader, only the
upper left corner of the SVG image appears (about 1 inch square). The
SVG file is created with JFreeChart, and is ok (I can view it using
batik).

I've played around with setting different values for the
external-graphic height, width, content-height, content-width, etc.
but to no avail. Setting the height and width seems to do something,
as the enclosing block is made larger, but the same small bit of the
image is all that appears. Here's the code snippet:

  <fo:block padding="6pt" background-color="lightblue">
    <fo:external-graphic src="file:test.svg" height="3in" width="6in"
                       content-height="3in" content-width="6in" />
  </fo:block>

Help!

I saw in the archive someone suggested supplying a
ChartRenderingObject to the draw method in JFreeChart in the context
of embed-foreign-object, but that didn't change anything.

Any help would be much appreciated!!

Thanks,
-David Mechner


Re: External graphic svg clipping problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
fop@mechner.com wrote:
> I'm including an SVG file in a simple .fo file (I'm not using XSL,
> just editing it by hand to get the template set up looking the way I
> want) and using FOP to process it. When I view the file, using either
> the FOP viewer or rendering to PDF and using Acrobat reader, only the
> upper left corner of the SVG image appears (about 1 inch square). The
> SVG file is created with JFreeChart, and is ok (I can view it using
> batik).
> 
> I've played around with setting different values for the
> external-graphic height, width, content-height, content-width, etc.
> but to no avail.
Content-height and content-width are not implemented.
You have to explicitely height and width on the
fo:external-graphic element to the same values as the
SVG has. If your SVG doesn't have an explicit height
and width set on the document element, or they are
not in a length unit, arrange that a height and with
in a length unit (cm, mm, pt) is present there.

J.Pietschmann