#!/usr/bin/python
from subprocess import *
import re
def convert(file):
p = Popen(['convert', file, file[:-3]+'pdf'], stdout=PIPE, stderr=PIPE)
p = Popen('ls', stdout=PIPE, stderr=PIPE)
ls, error = p.communicate()
files = re.split('\n', ls)
for i in files:
if i[-3:]=='xcf':
convert(i)
There are a few features missing and known bugs, e.g. it will convert every layer of the xcf file to a different page in the same pdf. (Beware of the python code formatting)
No comments:
Post a Comment