| <?xml version="1.0"?> |
| <!DOCTYPE document SYSTEM "./dtd/document-v10.dtd"> |
| |
| <!-- ========================================================================= --> |
| <!-- Copyright (C) The Apache Software Foundation. All rights reserved. --> |
| <!-- --> |
| <!-- This software is published under the terms of the Apache Software License --> |
| <!-- version 1.1, a copy of which has been included with this distribution in --> |
| <!-- the LICENSE file. --> |
| <!-- ========================================================================= --> |
| |
| <!-- ========================================================================= --> |
| <!-- author vincent.hardy@eng.sun.com --> |
| <!-- version $Id$ --> |
| <!-- ========================================================================= --> |
| |
| <document> |
| <header> |
| <title>Batik - SVG Rasterizer</title> |
| <subtitle>A cross platform SVG Rasterizer</subtitle> |
| <authors> |
| <person name="Vincent Hardy" email="vincent.hardy@eng.sun.com"/> |
| </authors> |
| </header> |
| |
| <body> |
| <s1 title="Introduction"> |
| |
| <figure src="images/rasterizer.jpg" alt="Batik SVG Rasterizer" /> |
| |
| <p> |
| This page describes the features of the SVG Rasterizer utility that |
| comes with the Batik distribution. It discusses the following:</p> |
| <ul> |
| <li><link href="#downloading">Downloading the rasterizer</link></li> |
| <li><link href="#using">Rasterizing one or several SVG files</link></li> |
| </ul> |
| <p> |
| The SVG Rasterizer is a utility that can convert SVG files to a |
| raster format. The tool can convert individual files or sets of |
| files, making it easy to convert entire directories of SVG |
| files. The two by default formats are JPEG and PNG, however the |
| design allows new formats to be added easily. |
| </p> |
| |
| </s1> |
| |
| <anchor id="downloading" /> |
| <s1 title="Downloading the rasterizer"> |
| |
| <p>Refer to the <link href="install.html">install page</link> and the |
| <link href="dist">download area</link> to find out what to download and how to |
| download it. Remember that you can get either the developer distribution |
| or the binary distribution.</p> |
| </s1> |
| |
| <anchor id="using" /> |
| <s1 title="Rasterizing one or several SVG files"> |
| <p>The method for starting the rasterizer depends on the distribution of Batik |
| that you chose to download. The following describes how to start the viewer |
| for each distribution.</p> |
| |
| <anchor id="usingBinary" /> |
| <s2 title="Using the binary distribution" > |
| |
| <p>If you downloaded the binary distribution of Batik, you should have |
| gotten a file called <em>batik-1.0beta.zip</em>, and, after expanding that |
| file, a JAR (Java ARchive) file called <em>batik-rasterizer.jar</em>. |
| To start the rasterizer, open a console, go to the directory where you |
| expanded the distribution (and where batik-rasterizer.jar is located) and |
| simply type the following at the command prompt :</p> |
| <p><em>java -jar batik-rasterizer.jar [@files]</em></p> |
| <p>For example, if you type:</p> |
| <p><em>java -jar batik-rasterizer.jar samples/batikFX.svg</em></p> |
| <p>you will see the following printout:</p> |
| <p><em>Converting file:samples/batikFX.svg to ./samples/batikFX.png</em></p> |
| <p>Once the conversion is complete, you will find a batikFX.png file in the samples |
| directory</p> |
| <p>You can pass options to the command line:</p> |
| <p><em>java -jar batik-rasterizer.jar [-d <directory>] [-m <mimeType>] [@files]</em></p> |
| <p>Where:</p> |
| <ul> |
| <li><em>-d <directory></em> lets you select the directory where the raster files will |
| be generated.</li> |
| <li><em>-m <mimeType></em> lets you select the mime type corresponding to the desired |
| raster format for the generated images. Currently, the tool supports <em>image/jpg</em> and |
| <em>image/png</em>. The default value is <em>image/png</em></li> |
| </ul> |
| <p>For example:</p> |
| <ul> |
| <li><em>java -jar batik-rasterizer.jar -d myDir -m image/jpg samples\*.svg</em> will generate JPEG images |
| for all the SVG files found in the samples directory.</li> |
| </ul> |
| </s2> |
| |
| <s2 title="Using the developer distribution"> |
| |
| <p>If you downloaded the developer distribution of Batik, you |
| got a zip or tar file that expanded into an xml-batik directory. In that directory, you |
| can find build scripts for the platform you are running on. For example, there is |
| a build.bat script for users of the Windows platform and there is a build.sh script |
| for UNIX users.</p> |
| <p>To start the rasterizer you should:</p><ul> |
| <li>Make sure the xml-batik directory is in your PATH environment variable</li> |
| <li>Make sure the ANT_HOME environment variable is set to the xml-batik directory</li> |
| <li>Make sure that your JAVA_HOME environment variable is set to your JDK installation |
| directory</li> |
| <li>Open a command line window and go to the xml-batik directory where the Batik |
| distribution was expanded</li> |
| <li><strong>UNIX users</strong>. If you have not done so already, make the build.sh script |
| executable:<br /> |
| <em>chmod +x build.sh</em></li> |
| <li>At the command prompt, type: <br /> |
| <strong>Windows: </strong><em>build svgrasterizer</em>.<br /> |
| <strong>UNIX: </strong><em>build.sh svgrasterizer</em>.<br /> |
| This will printout a |
| help message for the rasterizer</li> |
| </ul> |
| <p>You can pass options to the rasterizer as follows:</p> |
| <p><strong>Windows: </strong><em>build svgrasterizer -Dargs="[-d <directory>] [-m <mimeType>] [@files]"</em></p> |
| <p><strong>UNIX: </strong><em>build.sh svgrasterizer -Dargs="[-d <directory>] [-m <mimeType>] [@files]"</em></p> |
| <p>Refer to <link href="#usingBinary">"Using the binary distribution" </link>for an explanation of these |
| options</p> |
| </s2> |
| |
| </s1> |
| </body> |
| </document> |