Changeset afb311e in sasview
- Timestamp:
- Feb 27, 2018 8:54:04 AM (7 years ago)
- Parents:
- 943e17a (diff), a64772c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Wojciech Potrzebowski <Wojciech.Potrzebowski@…> (02/27/18 08:54:04)
- git-committer:
- GitHub <noreply@…> (02/27/18 08:54:04)
- Location:
- src/sas
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/report_dialog.py
r69a6897 ra64772c 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 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) 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) 139 143 return False
Note: See TracChangeset
for help on using the changeset viewer.