>
> def courrier_mkiv(request, pk2, pk1):
>     entry = Courrier.objects.get(pk=pk2)
>     cource = Patient.objects.get(pk=pk1)
>     context = dict({'courrier': entry, 'patient': cource})
>     # buffer = BytesIO()
>     template = get_template('courrier/courrier.mkiv')
>     rendered_tpl = template.render(context, request).encode('utf-8')
>     with tempfile.TemporaryDirectory() as tempdir:
>     # mtxrun --path=/data/foo --script context
>         process = Popen(['mtxrun', '--path', tempdir,
>                         '--script=context'
>                         '--result'],
>                         stdin=PIPE,
>                         stdout=PIPE,
>                         )
>         process.communicate(rendered_tpl)
>     with open(os.path.join(tempdir, 'textput.pdf'), 'rb') as f:
>         pdf = f.read()
>     r = HttpResponse(content_type='application/pdf')
>     r.write(pdf)
>     return r


i tried this without success :(
the only workaround u've found for now is to render a tex file and copile
it manually.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to