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())

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 .