def testCGI(data="Hello <b>World</b>"):

    result = cStringIO.StringIO()

    pdf = pisa.CreatePDF(
        cStringIO.StringIO(data),
        result
        )

    if pdf.err:
        print "Content-Type: text/plain"
        print
        dumpErrors(pdf)
    else:
        print "Content-Type: application/octet-stream"
        print
        sys.stdout.write(result.getvalue())
This one shows, how to get the resulting PDF as a
dataset/ETHPy150Open xhtml2pdf/xhtml2pdf/test/simple.py/testCGI