Guest User

Untitled

a guest
Jun 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import sys
  2. import os
  3.  
  4. inFile = sys.argv[1]
  5. currDir = os.path.abspath(os.path.curdir)
  6. inEnding = os.path.splitext(inFile)[1]
  7. fileName = inFile[0: len(inFile) -len(inEnding)]
  8.  
  9. originalFont = "Arial"
  10. newFont = "Utopia"
  11.  
  12. tempFileName = fileName +".temp.svg"
  13. o = open(tempFileName, "w")
  14.  
  15. for line in open(os.path.join(currDir, inFile)):
  16. line = line.replace(originalFont, newFont)
  17. o.write(line + "\n")
  18. o.close()
  19.  
  20. print "------------------------------"
  21. print "calling inkscape"
  22. command= 'inkscape "{0}\{1}" -D --export-pdf "{0}\{2}.pdf"'.format(currDir, tempFileName, fileName)
  23. os.system(command)
  24. os.remove(os.path.join(currDir, tempFileName))
  25. print "done"
  26. print "------------------------------"
Add Comment
Please, Sign In to add comment