Changes in / [afb311e:943e17a] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/report_dialog.py
ra64772c r69a6897 125 125 : filename: name of file to be saved 126 126 """ 127 #try: 128 from xhtml2pdf import pisa 129 # open output file for writing (truncated binary) 130 resultFile = open(filename, "w+b") 131 # convert HTML to PDF 132 #data = '<html><head><meta http-equiv=Content-Type content=text/html; charset=windows-1252><meta name=Generator ></head><body lang=EN-US>' \ 133 # '<div class=WordSection1><p class=MsoNormal><b><span ><center><font size=4 >cyl_400_40.txt [Feb 26 2018 12:04:42]</font></center></span></center></b></p>' \ 134 # '<img src="Untitled_img1.png" ></img></div></body></html>' 135 pisaStatus = pisa.CreatePDF(data, dest=resultFile, debug=True, show_error_as_pdf=True) 136 # close output file 137 resultFile.close() 138 self.Update() 139 # return pisaStatus.err 140 #except Exception: 141 # logger.error("Error creating pdf: %s" % sys.exc_value) 142 logger.error("Error creating pdf: %s" % pisaStatus.err) 127 try: 128 from xhtml2pdf import pisa 129 # open output file for writing (truncated binary) 130 resultFile = open(filename, "w+b") 131 # convert HTML to PDF 132 pisaStatus = pisa.CreatePDF(data, dest=resultFile) 133 # close output file 134 resultFile.close() 135 self.Update() 136 return pisaStatus.err 137 except Exception: 138 logger.error("Error creating pdf: %s" % sys.exc_value) 143 139 return False
Note: See TracChangeset
for help on using the changeset viewer.