def testURL(url='http://www.htmltopdf.org', dest='test-website.pdf'):
 import urllib
 pdf = pisa.CreatePDF(urllib.urlopen(url), file(dest, 'wb'), log_warn=1, log_err=1, path=url, link_callback=pisa.pisaLinkLoader(url).getFileName)
 dumpErrors(pdf)
 if (not pdf.err):
  pisa.startViewer(dest)

def testURL ( url = 'http://www.htmltopdf.org' , dest = 'test-website.pdf' ) : import urllib pdf = pisa . CreatePDF ( urllib . urlopen ( url ) , file ( dest , 'wb' ) , log_warn = 1 , log_err = 1 , path = url , link_callback = pisa . pisaLinkLoader ( url ) . getFileName ) dumpErrors ( pdf ) if ( not pdf . err ) : pisa . startViewer ( dest )
loading from an url .