forgot to mention: * the instructions are for a unix/linux/macosx server but should be only slightly different under Windows * you need to make sure that the user which runs the php process has access to the jar files and has write permission to the directory where the files will be generated. In my case its the same user running the Apache process. * in any case, Apache expects a .svg or .svgz file extension, so in case your SVG content is dynamically created by a script, be sure that in your URL, it ends with .svg, e.g. some.php?param1=123¶m2=2341234&format=.svg - note that format is just a dummy parameter, but the .svg is what counts
Andreas --- In [email protected], "Andreas Neumann" <[EMAIL PROTECTED]> wrote: > > 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 ----- 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/

