svgDOM Examples
simple Example
#
package require svgDOM 0.04
#
set fileInput .... ; # define your input fileName
set fileOutput ... ; # define your output fileName
#
#
set svgObject [::svgDOM::SVG new file $fileInput]
#
# default pathType is "fraction for use in tk::canvas
# to export optimized for tkpath set pathType to "path"
#
$svgObject pathType path
#
# get the converted svg-content
#
set svgXML [$svgObject getSVG]
#
# prepare output to write it to a svg-file
#
set outputContent {<?xml version="1.0" encoding="UTF-8" standalone="no"?>}
append outputContent "\n" [$svgXML asXML -doctypeDeclaration 1]
#
#
set fp [open $fileName w]
puts $fp $outputContent
close $fp
#
provided Tests
Please check the package directory of svgDOM. Here you will find a directory test.
This directory contains a test script test_SVG.tcl and svg-example-files in
several directories.
Feel free to dive into svgDOM ...
svgDOM
├───pkgIndex.tcl ......... package svgDOM
├───svgDOM.tcl ........... package svgDOM
├───lib .................. package svgDOM
└───test
├───__export ......... export directory of test_SVG.tcl
├───_debug
├───_investigate
├───_sample
├───_sampleW3C
├───_www ............. examples used in this doc
└───test_SVG.tcl