O'Reilly logo

Java™ Drawing with Apache Batik: A Tutorial by Alexander Kolesnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Your First SVG Document

In this section you will create a simple SVG document and use Squiggle to view it. This section presents a good opportunity to test different features of the SVG browser. You will also convert your SVG document into a JPEG file.

To start, open your favorite text or XML editor and type the code shown in Listing 1.1. Save it as first.svg into a directory of your choice, such as c:\batik\work. Alternatively, if you have downloaded the accompanying source codes for this book, you can simply copy and paste the code. You can find the code in the ch01 directory.

Listing 1.1. The first.svg file
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required