Latex+django problem was solved

I was solved the problem of latex + django. Now able to create the pdf using latex in django.

How i solve this, Just using

Call()
</pre?
Function here is code:-

import os
from django.template.loader import render_to_string
from subprocess import call
def home(request):
texfile = os.open('/home/sofat/latex/tamplate/my_latex_tamplate.tex', os.O_RDWR)
texfilename = "/home/sofat/latex/tamplate/my_latex_tamplate.tex"
os.write(texfile, render_to_string('my_latex_tamplate.tex', {'content':'sofa'}))
os.close(texfile)
os.remove(texfilename)
call(['pdflatex', texfilename])
return
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s