This page describes the features of the SVG pretty printer utility that comes with the Batik distribution. The SVG pretty printer is a utility that can format SVG files. The tool formats an SVG document according to the arguments passed on the command line.
Refer to the install page and the download page to find out what to download and how to download it. Remember that you can get either the source or binary distribution.
The method for starting the pretty-printer depends on the distribution of Batik that you chose to download. The following describes how to run the pretty printer for each distribution.
If you downloaded the binary distribution of Batik, you should have
a file called batik-1.6.zip (or similar), and, after
expanding that file, a jar file called batik-svgpp.jar.
To start the pretty printer, open a console, change to the directory
where you expanded the distribution (and where
batik-svgpp.jar is located) and simply type the following
at the command prompt:
For example, if you type:
java -jar batik-svgpp.jar samples/batikFX.svg
you will see the indented document written to standard output.
For the options:
For example:
will format src.svg and write it to
dest.svg using a tabulation width of 2 and Windows-style
newlines, and:
will format src.svg and write it to
dest.svg unchanged, except for the doctype public and
system IDs, which will be replaced by those specified.
If you downloaded the source distribution of Batik, you will have a
zip or tar file that expanded into a directory called
xml-batik or batik-version. 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.
To start the pretty printer you should:
Make sure that your JAVA_HOME environment
variable is set to your JDK installation directory.
Open a command line window and go to the xml-batik
or batik-version directory where the Batik
distribution was expanded.
For Windows, type the following at the command prompt:
and for Unix:
This will print out a help message for the pretty printer.
You can pass options to the rasterizer as follows, for Windows:
and for Unix:
Refer to “Using the binary distribution” for an explanation of these options.