Browse Source

Merge branch 'jethro'

remotes/origin/prednasky
parent
commit
3d564f555d
  1. 3
      seminar/views.py

3
seminar/views.py

@ -555,7 +555,8 @@ def soustredeniStvrzenkyExportView(request,soustredeni,first_num):
texfile.write(tex.decode("utf-8").encode("utf-8")) texfile.write(tex.decode("utf-8").encode("utf-8"))
shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/stvrzenka.sty'),tempdir) shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/stvrzenka.sty'),tempdir)
shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/stvrzenky.tex'),tempdir) shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/stvrzenky.tex'),tempdir)
subprocess.call(["pdfcslatex","stvrzenky.tex"],cwd = tempdir) subprocess.call(["cslatex","stvrzenky.tex"],cwd = tempdir)
subprocess.call(["dvipdf","stvrzenky.dvi"],cwd = tempdir)
with open(tempdir+"/stvrzenky.pdf","rb") as pdffile: with open(tempdir+"/stvrzenky.pdf","rb") as pdffile:
response = HttpResponse(pdffile.read(),content_type='application/pdf') response = HttpResponse(pdffile.read(),content_type='application/pdf')

Loading…
Cancel
Save