Hi Harvey, in http://www.carto.net/williams/yosemite/ we use Batik to create printable maps in PDF format. It is not too quick, since its not yet used as part of a servlet, but issued at a single command, which is also has to load the java runtime engine for each conversion.
In the above URL (works best in Opera, but also in ASV, and with some limitations in Firefox and Safari (future version)), go to the printing tab and follow the instructions. When you create a map in pdf a PHP generates the server and feeds it into Batik rasterizer which converts it to PDF (despite the rasterizer name, it preserves vectors as vectors in the PDF format). I currently use this command: /usr/lib/jvm/jre-1.5.0-sun/bin/java -Xmx512M -jar /home/username/ batik/batik-rasterizer.jar -d /home/username/temp/somename.pdf -m application/pdf -onload somename.svg Be sure that the pathes to the java command and to the batik- rasterizer.jar file are correct. Also in the same directory where batik-rasterizer.jar resides, there should be all the other batik jar files. Instead of -m application/pdf just use -m image/png This command can be issued by any scripting language, e.g. PHP: In PHP I use: $command = '/usr/lib/jvm/jre-1.5.0-sun/bin/java -Xmx512M -jar /home/ username/batik/batik-rasterizer.jar -d /home/username/temp/ somename.pdf -m application/pdf -onload somename.svg'; $command = escapeshellcmd($command); $result = exec($command,$output,$retval); and then provide some feedback to the web browser that the conversion is finished and how the filename of the png/pdf is called. Note, that it is much faster if you start the rasterizer conversion from a servlet engine, such as Apache Tomcat, but I haven't done this myself. Perhaps someone else on this list has dones this already and can provide an example file. There is also a Batik mailinglist which will provide support for your case: http://xmlgraphics.apache.org/batik/mailing-lists.html Hope this helps a bit. I am also not a Java expert and am sure there are other competent people on this or the Batik lists who can help in case that you are stuck. Andreas --- In [email protected], "Harvey Rayner" <[EMAIL PROTECTED]> wrote: > > hello, > > > > i've downloaded batik on my pc and had a play. when it converts to png it > doesn't create the slight border around an image like you would see > exporting svg from coreldraw or illustrator to a raster image. this is > fantastic, as i don't have to mess around over-sizing and cropping. > > > > now, to use rasterizer in my web ap, do i simply host the > 'batik-rasterizer.jar' file on my server and pass (is this the right > terminology) the svg to this file? > > > > i have zero experience of java. does the .jar have to be installed? > > > > i know it won't be as simple as this in my case as my svg color values are > contained in javascript, but just to make a simple start and understand how > it works - what would be an example of the code i'd need to pass a static > svg file to the rasterizer to be converted to png? > > > > i've searched for an answer on the net, but am probably searching for the > wrong terms. > > > > any help would be greatly appreciated. > > > > thanks > > > > harvey > > > > > > > > [Non-text portions of this message have been removed] > ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups - Join or create groups, clubs, forums & communities. Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups - Join or create groups, clubs, forums & communities. is subject to: http://docs.yahoo.com/info/terms/

