On 17.11.2008 18:01:20 Martin Jacobson wrote:
> I'm only using the batik-rasterizer while I'm prototyping - soon I  
> shall be generating PDF using fop from an SVG DOM representation. As a  
> hack, I suppose I can unjar the standard batik-rasterizer, fix up the  
> MANIFEST.MF to include the fop stuff, and re-jar it?

Yes, of course.

> As a Java web developer, I am only too happy to have Tomcat look after  
> class loading--classpaths are a nightmare!

Hehe, you'll get used to it.

> (Oh, and I'd like static methods in interfaces, too, please!)
> 
> thanks,
> Martin
> 
> On 17 Nov 2008, at 16:42, Jeremias Maerki wrote:
> 
> > On 17.11.2008 15:08:52 Martin Jacobson wrote:
> >> Although we have text appearing, I'd like to resolve the issue of
> >> using the latest FOP in batik; using standard Batik 1.7 results in  
> >> ALL
> >> text being transcoded as paths!
> >>
> >> I've always had difficulties understanding Java's concept of
> >> Classpath, so please excuse me! The doc. for using
> >> batik-rasterizer.jar instructs you to cd to the directory containing
> >> the jar and execute the "java -jar batik-rasterizer..." command from
> >> there. Even with an empty CLASSPATH, the jar manages to find other
> >> jars in the lib directory below, so it must be hard-coded, surely?
> >
> > Yes, open batik-rasterizer.jar in your favourite ZIP tool and take a
> > look at the META-INF/MANIFEST.MF file. There, you'll find all the
> > entries (Look for the "Class-Path" entry). But that mechanism has its
> > limits. I don't like it too much.
> >
> >> Anyway, I tried this
> >>
> >> export CLASSPATH=/usr/local/batik-1.7/lib:$CLASSPATH; java -jar ...
> >
> > The use of the CLASSPATH environment variable is generally considered
> > bad practice because it can lead to trouble when running multiple Java
> > applications on one machine.
> >
> >> and
> >>
> >> java -cp /usr/local/batik-1.7/lib java -jar ...
> >
> > -jar and -cp doesn't work together, unfortunately. And Java doesn't  
> > pick
> > up all JARs if you just specify a directory.
> >
> > The suggested way is using only -cp, but in this case, you have to  
> > know
> > the main class of the Batik Rasterizer. You can find that in the
> > MANIFEST.MF file, too (Value: Main-Class).
> >
> > java -cp
> > /usr/local/batik-1.7/batik-dom.jar:/usr/local/batik-1.7/batik- 
> > gvt.jar:/usr..... org.apache.batik.apps.rasterizer.Main
> > ....
> >
> > It's probably best if you write a little shell script. I know that
> > feels like: What? Is there no better way? Actually there are better  
> > ones
> > but not without Java knowledge. In FOP, we use normally use scripts,  
> > too,
> > although FOP has a special "-jar" mode which does a dynamic class path
> > setup. But that would first have to be ported to Batik before you  
> > could
> > use it.
> >
> >> Neither worked, in that neither cured the original exception:
> >>
> >> Exception in thread "main" java.lang.NoClassDefFoundError:
> >> org/apache/xmlgraphics/image/loader/ImageContext
> >>       at java.lang.Class.forName0(Native Method)
> >>       at java.lang.Class.forName(Class.java:164)
> >>       at  
> >> org 
> >> .apache 
> >> .batik 
> >> .apps.rasterizer.DestinationType.getTranscoder(DestinationType.java: 
> >> 96)
> >>       at  
> >> org 
> >> .apache 
> >> .batik.apps.rasterizer.SVGConverter.execute(SVGConverter.java:690)
> >>       at org.apache.batik.apps.rasterizer.Main.execute(Main.java:938)
> >>       at org.apache.batik.apps.rasterizer.Main.main(Main.java:992)
> >>
> >> Any ideas would be welcome!
> >>
> >> Martin
> > <snip/>
> >
> >
> >
> >
> > Jeremias Maerki
> >



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to