import os
file = "uracoli_modules.odg"
names = [None, None, "trx", "radio", "sensors", "hif", "timer", "utils", "gpio", "library", "examples", "applications"]
for i in range(1,len(names)+1):
if names[i]:
ofile = "uracoli_modules_%s" % names[i]
else:
ofile = "uracoli_modules"
print "convert %s" % ofile
cmd = 'unoconv -f pdf --stdout -e "PageRange=%d" %s > %s.pdf' % (i, file, ofile)
print cmd
os.system(cmd)
os.system('convert %s.pdf -fuzz 1%% -trim +repage %s.png' % (ofile, ofile))