junglejourney

view materials/svg2png_previews.py @ 214:e46ec73973f1

Added a simple tool to generate PNG previews of pages.
author David Boddie <david@boddie.org.uk>
date Sat Oct 15 20:52:19 2011 +0200
parents
children
line source
1 #!/usr/bin/env python
3 import os, sys
5 if __name__ == "__main__":
7 if not 1 <= len(sys.argv) <= 2:
9 sys.stderr.write("Usage: %s [resolution in dpi]\n" % sys.argv[0])
10 sys.exit(1)
12 elif len(sys.argv) == 2:
13 resolution = int(sys.argv[1])
14 else:
15 resolution = 144
17 for i in range(4):
18 os.system("inkscape -e png/page-%i.png -d %i -y 255 svg/page-%i.svg" % (i, resolution, i))
20 os.system("inkscape -e png/cover.png -d %i -y 255 cover.svg" % resolution)
22 sys.exit()