






































|
This page describes the main features of the SVG Browser that comes with Batik.
It discusses the following:
|
Refer to the download area to find out how to
download Batik. Remember that you can get either the developer distribution
or the binary distribution.
Refer to the installation page for instructions
on how to install the Batik download on your system.
|
The method for starting the browser depends on the distribution of Batik
that you chose to download. The following describes how to start the browser
for each distribution
 |  |  |  | Starting the browser for the binary distribution |  |  |  |  |
If you downloaded the binary distribution of Batik, you should have
gotten a file called batik-1.0.zip, which, when expanded,
created a batik-svgbrowser.jar file. To start the browser,
type the following on the command line:
cd <installationDirectory>
java -jar batik-svgbrowser.jar
You can pass options to the command line:
java -jar batik-svgbrowser.jar [-font-size <fontSize>] [svgURL]*
Where:
- -font-size <fontSize> will make the browser use small fonts in the GUI.
- [svgURL]* the URLs for the SVG files the browser should open when it starts
For example:
- java -jar batik-svgbrowser.jar -font-size 10 starts the browser with small fonts.
- java -jar batik-svgbrowser.jar -font-size 10 samples/batikLogo.svg starts the browser with
the batikLogo.svg file open (and small fonts,
because of -font-size)
|
The following image shows the result of starting the browser, in the binary or
developer distribution, with the -font-size 10 samples/batikFX.svg options.

|
|
The browser has several features to view and browse SVG documents:
In situations where you have an SVG file locally on the machine where you are running the
Batik SVG browser, you can use the "File->Open File" menu item to open that file, or use
the "Ctrl-F" key accelerator. Doing so brings up a file choser that lets you select the file
you want to view.

|
As with HTML content, it is common to navigate back and forth between SVG files (remember that
SVG files contain hyperlinks, just like HTML does) and, as described later in this document,
it is possible to zoom into SVG documents, pan and rotate.

The Batik browser offers multiple features to help you browse SVG files:
- Navigating between files. The "Go->Back" menu item (or the Ctrl-left arrow
keyboard acceleration) and the "Go->Forward" (or the Ctrl-right arrow keyboard acceleration)
let you move to the previous and next visited SVG documents
- History. The "Go" menu also contains a list of the visited SVG documents,
which gives you a way to randomly access any document you have already visited.
- Navigation between views. The "View->Previous Transform" menu item (Ctrl-L)
and the "View->Next Transform" menu item (Ctrl-N) let you go to the previous or next view
you have had of a document. This is useful when, for example, you pan or rotate and document
and want to go back to any previous view you had of the document (i.e., before you panned or
rotated it).
|
|
 |  |  |  | Configuring the SVG Browser |  |  |  |  |
The "Edit->Preferences" menu brings up the dialog box shown in the following
figure.

This dialog contains several types of options, which can be selected with
the left-hand side list. For each type of option, a panel lets you configure various
browser parameters:
- Network Options Panel. This panel lets you configure the
proxy server to use if you are working from behind a firewall.
- Languages Panel. This is the panel shown in the above
figure. That panel lets you select your languages. The user language can
be used in SVG documents to choose between alternate contents. For example,
open the samples/moonPhases.svg example. Then, change the user language to
french and reload the document (Ctrl-R). You will see that the text is now
displayed in french. You can do the same with Japanese and the text will be
shown in Japanes.
- Browser Options Panel. This panel lets you choose some
optional behaviors:
- Show Rendering. When on, the browser will update the canvas
while processing an SVG document. This turns on progressive rendering.
- Auto Adjust Window. When on, the browser window is resized to fit
any newly loaded document
- Enable Double Buffering. When on, the browser uses additional
memory resources which improves the quality of effects such as zooming
and panning.
- Show debug traces. When on, so debug messages will be printed to
the standard output. This is only for developers.
- Stylesheet Panel. This panel lets you specify a user
stylesheet which can override some of the default settings in viewed SVG
documents. This might be useful if you want, for example, to override the
font size used in text elements.
|
 |  |  |  | Navigating SVG documents: Zooming, panning, rotating, transform and thumbnail |  |  |  |  |
The Batik browser offers multiple way to navigate SVG documents:
There are several methods to zoom in or out an SVG Document:
- You can select the "View -> Zoom In/Out" menu item
- You can click on the "Zoom In/Out" tool bar button (the ones that show a magnifying glass
with a "+/-" signs)
- You can use the "Ctrl+I" and "Ctrl+O" keyboard acceleration
- If the mouse is over the document in the display area, you can press the Ctrl key
then click the left mouse button and drag to select the area of interest in the document.
This can only be used to zoom into a document.
- If the mouse is over the document in the display area, you can press the Shift key
then click the right mouse button and drag it. This is called the 'real time' zoom
and can be used both for zooming in and out.


|
Some documents are too big to fit into the browser, especially when you zoom in with a
large zoom factor. In these circumstances, it is usefull to be able to 'move around' the
document and pan to view different parts of the documents. Again, there are multiple ways
to do this:
- With the mouse cursor over the SVG document, press the Shift key and then
click and drag the left mouse button to a new location. When you release the
mouse, the document will be translated to the new mouse location.
- If you have the thumbnail open, you can select the marker showing the current
area of interest and move it to the desired location

|
It is sometimes useful to be able to rotate a document (maps for example). You can
do this in the Batik browser by first pressing the Ctrl key and then clicking and dragging
the right mouse button to a new location. The browser will dynamically rotate the image
as you move your cursor. When you are satisfied with that angle, you can release
the mouse button and the document will be displayed with that new angle.
|
Panning in the document window can be difficult after you have zoomed into a document
because you cannot see the whole document. Panning on large documents (or with a large
zoom factor) is made easy by the thumbnail that you can bring up through the
"View -> Thumbnail" menu item or Ctrl-Y keyboard acceleration. The
thumbnail shows a rectangular marker that represents the "Area of Interest", i.e., the
region currently displayed in the window (the visible portion of the document). You
can drag that little marker with the left mouse button and drag it to another area
of interest to view a different portion of the document in the main window.

|
|
|
|