PDFkit write directly to the HTTP response
<p>I have a server which I dont have write access,I want to generate a pdf with pdfkit and just write its contents to the HTTP response without saving first the file to a temp file in the server.The following code doesn't work</p>

<pre><code>import cgitb
cgitb.enable()
print "Content-Type: application/pdf;\n"

import base64
from io import BytesIO
import sys
import pdfkit

data=pdfkit.from_string("asfddsgsdfg", False, {
    'page-size': 'Letter',
    'margin-top': '0.75in',
    'margin-right': '0.75in',
    'margin-bottom': '0.75in',
    'margin-left': '0.75in',
    'encoding': "UTF-8",
    'orientation': 'Landscape'
})

sys.stdout.write(data)
</code></pre>