You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Gisbert van Rossum <gv...@springsite.com> on 2003/08/05 11:36:48 UTC

Nullpointer Exception when using units in

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="..." />.

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

Re: Nullpointer Exception when using units in

Posted by Thomas DeWeese <Th...@Kodak.com>.
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