diff --git a/System/Vacuum/Cairo.hs b/System/Vacuum/Cairo.hs
--- a/System/Vacuum/Cairo.hs
+++ b/System/Vacuum/Cairo.hs
@@ -15,7 +15,7 @@
 module System.Vacuum.Cairo (
 
     view
-
+,   viewFile -- export to .svg file
  ) where
 
 import qualified Graphics.UI.Gtk as G
@@ -203,7 +203,16 @@
     yield
     return ()
 
-
+-- | Render a value to a file
+viewFile :: String -> a -> IO ()
+viewFile file a = do
+   let dot = render . myPpDot . (showHNodes myStyle) $ vacuum a
+   mdot <- findExecutable "dot"
+   let exe = case mdot of
+               Nothing -> error "\"dot\" executable not found. please install graphviz"
+               Just p  -> p 
+   svgstring <- myReadProcess exe ["-Tsvg"] dot
+   writeFile file svgstring
 
 updateCanvas :: C.SVG -> G.DrawingArea  -> IO Bool
 updateCanvas svg canvas = do
diff --git a/vacuum-cairo.cabal b/vacuum-cairo.cabal
--- a/vacuum-cairo.cabal
+++ b/vacuum-cairo.cabal
@@ -1,5 +1,5 @@
 name:               vacuum-cairo
-version:            0.3.1
+version:            0.4
 cabal-version:      >= 1.2
 build-type:         Simple
 license:            BSD3
