#NEWLINE# def HTML2PDF( data , filename , open = False ) : #NEWLINE# #INDENT# '\n    Simple test showing how to create a PDF file from\n    PML Source String. Also shows errors and tries to start\n    the resulting PDF\n    ' #NEWLINE# pdf = pisa . CreatePDF ( io . StringIO ( data ) , file ( filename , 'wb' ) ) #NEWLINE# if ( open and ( not pdf . err ) ) : #NEWLINE# #INDENT# pisa . startViewer ( filename ) #NEWLINE# #UNINDENT# return ( not open . err )