djangosnippets.org: Latest snippets tagged with 'converter'https://djangosnippets.org/tags/converter/2009-11-04T08:08:44.076934-06:00pyText2Pdf - Python script to convert plain text into PDF file. Modified to work with streams.
2009-11-04T08:08:44.076934-06:00vsergeyevhttps://djangosnippets.org/snippets/1778/<p>This is "pyText2Pdf" - Python script to convert plain text into PDF file.
Originally written by Anand B Pillai.
It is taken from http://code.activestate.com/recipes/189858/</p>
<p>Modified to work with streams.</p>
<p>Example: produce PDF document from text and output it as HTTPResponse object.</p>
<pre><code>import StringIO
input_stream = StringIO.StringIO(text)
result = StringIO.StringIO()
pdfclass …</code></pre>
Freely redistributable