def testSimple(data='Hello <b>World</b><br/><img src="img/test.jpg"/>', dest='test.pdf'):
 pdf = pisa.CreatePDF(cStringIO.StringIO(data), file(dest, 'wb'))
 if pdf.err:
  dumpErrors(pdf)
 else:
  pisa.startViewer(dest)

def testSimple ( data = 'Hello <b>World</b><br/><img src="img/test.jpg"/>' , dest = 'test.pdf' ) : pdf = pisa . CreatePDF ( cStringIO . StringIO ( data ) , file ( dest , 'wb' ) ) if pdf . err : dumpErrors ( pdf ) else : pisa . startViewer ( dest )
simple test showing how to create a pdf file from pml source string .