def testBackgroundAndImage(src='test-background.html', dest='test-background.pdf'):
 pdf = pisa.CreatePDF(file(src, 'r'), file(dest, 'wb'), log_warn=1, log_err=1, path=os.path.join(os.getcwd(), src))
 dumpErrors(pdf)
 if (not pdf.err):
  pisa.startViewer(dest)

def testBackgroundAndImage ( src = 'test-background.html' , dest = 'test-background.pdf' ) : pdf = pisa . CreatePDF ( file ( src , 'r' ) , file ( dest , 'wb' ) , log_warn = 1 , log_err = 1 , path = os . path . join ( os . getcwd ( ) , src ) ) dumpErrors ( pdf ) if ( not pdf . err ) : pisa . startViewer ( dest )
simple test showing how to create a pdf file from pml source string .