java-gnome version 4.0.15

org.freedesktop.cairo
Class SvgSurface

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.freedesktop.cairo.Surface
              extended by org.freedesktop.cairo.SvgSurface

public class SvgSurface
extends Surface

A Surface that you can use to write to a SVG file. You should use it as in the following example:

 surface = new SvgSurface(filename, 100, 100);
 cr = new Context(surface);
 
 // do drawing 
 
 // and write to the file
 surface.finish();
 
It is important to call finish() at the end, to ensure contents are actually written to the file.

Since:
4.0.10
Author:
Vreixo Formoso

Constructor Summary
SvgSurface(String filename, double width, double height)
          Create a new SvgSurface.
 
Method Summary
 
Methods inherited from class org.freedesktop.cairo.Surface
copyPage, createSimilar, finish, flush, showPage, writeToPNG
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SvgSurface

public SvgSurface(String filename,
                  double width,
                  double height)
           throws IOException
Create a new SvgSurface.

Parameters:
filename - The file to write to.
width - width of the surface, in points (1 point == 1/72.0 inch)
height - height of the surface, in points (1 point == 1/72.0 inch)
Throws:
IOException - If you do not have write permissions on the given file.


java-gnome