xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gisbert van Rossum" <gvros...@springsite.com>
Subject RE: Re: Nullpointer Exception when using units in <svg:use>
Date Mon, 11 Aug 2003 07:44:55 GMT
Hi Thomas,

I do not understand what you mean, the attached svg source contains an
'svg' element.
For completeness, here's the source again:

<svg:svg
	viewBox="0 0 100 100"
	width="100"
	height="50"
	xmlns:svg="http://www.w3.org/2000/svg"
	xmlns:xlink="http://www.w3.org/1999/xlink">

	<svg:defs>
		<svg:polygon id="Star" points="-4,-1 -1,-1 0,-4 1,-1
4,-1 2,1 3,4 0,2 -3,4 -2,1"/>
	</svg:defs>

	<svg:rect width="100" height="100" x="0" y="0" fill="yellow"/>

	<svg:use x="50%" y="50%" xlink:href="#Star"
style="fill:limegreen;stroke:black;stroke-width:0.7px;"/>

</svg:svg>

Hi Gisbert,

Gisbert van Rossum wrote:
> Hi there!
>
> I'm trying to render the attached file using FOP 0.20.5 (which uses
> Batik 1.5beta4 as they say).
> This file contains a <svg:use x="50%" y="50%" xlink:href="..." />.

   Every SVG fragment must have an 'svg' element to define the
SVG viewport.  99% cetain This is your problem.

> when executing FOP with:
>
> fop svgUse.fo test.pdf
>
> I get the following NullpointerException:
>
> [ERROR] svg graphic could not be built: null
> java.lang.NullPointerException
>         at

org.apache.batik.bridge.UnitProcessor$DefaultContext.getViewportWidth(Un

> itProcessor.java:382)
>         at

org.apache.batik.util.UnitProcessor.percentagesToPixels(UnitProcessor.ja

> va:223)
>         at

org.apache.batik.util.UnitProcessor.svgToUserSpace(UnitProcessor.java:16

> 6)
>         at

org.apache.batik.util.UnitProcessor.svgToUserSpace(UnitProcessor.java:13

> 1)
>         [... see attachment for full stacktrace ...]
>
> Viewing the SVG in Batik-Squiggle however works perfectly! The Batik
> source UnitProcessor.java doesn't contain a line number 382,

apparently

> the beta version code of this class differs from the final 1.5

version.

> When I remove the '%' from the positioning attributes x and y of
> svg:use, there is no problem.
> The smae problem exists when I use 'cm' instead of '%'
>
> Can you tell me what I am doing wrong, or how to fix this problem?
>
> My platform is Win2k, j2sdk1.4.0.
>
> btw: I submitted a bug report in Bugzilla
> (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21846). I'm afraid

I

> did this too soon. Sorry about that.
>
> thanx & greetings,
> Gis van Rossum

------------------------------------------------------------------------

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

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

-------------------------------------------------------


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

-------------------------------------------------------


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


Mime
View raw message