Skip to content

Instantly share code, notes, and snippets.

@Superbil
Created July 19, 2012 05:59
Show Gist options
  • Save Superbil/3141068 to your computer and use it in GitHub Desktop.
Save Superbil/3141068 to your computer and use it in GitHub Desktop.
use pyswf to convert to svg
#!/usr/bin/python
import sys
if len(sys.argv) > 1:
file_name = sys.argv[1]
else:
print "no input file name"
exit()
from swf.movie import SWF
from swf.export import SVGExporter
# create a file object
file = open(file_name, 'rb')
# load and parse the SWF
swf = SWF(file)
# create the SVG exporter
svg_exporter = SVGExporter()
# export!
svg = swf.export(svg_exporter)
# save the SVG
open(file_name+'.svg', 'wb').write(svg.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment