Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import os
- inFile = sys.argv[1]
- currDir = os.path.abspath(os.path.curdir)
- inEnding = os.path.splitext(inFile)[1]
- fileName = inFile[0: len(inFile) -len(inEnding)]
- originalFont = "Arial"
- newFont = "Utopia"
- tempFileName = fileName +".temp.svg"
- o = open(tempFileName, "w")
- for line in open(os.path.join(currDir, inFile)):
- line = line.replace(originalFont, newFont)
- o.write(line + "\n")
- o.close()
- print "------------------------------"
- print "calling inkscape"
- command= 'inkscape "{0}\{1}" -D --export-pdf "{0}\{2}.pdf"'.format(currDir, tempFileName, fileName)
- os.system(command)
- os.remove(os.path.join(currDir, tempFileName))
- print "done"
- print "------------------------------"
Add Comment
Please, Sign In to add comment