Skip to content

Commit

Permalink
bugfix: sauve rapport HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrick-f committed Apr 24, 2021
1 parent a82e8ec commit 5443ae6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/rapport.py
Original file line number Diff line number Diff line change
Expand Up @@ -1932,11 +1932,12 @@ def Enregistrer(self, titre, nomFichierDefaut = "", dialog = True):
handler = rt.RichTextHTMLHandler()
handler.SetFlags(rt.RICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY)
handler.SetFontSizeMapping([7,9,11,12,14,22,100])
stream = io.StringIO()
if handler.SaveStream(self.GetBuffer(), stream):
f = open(nomFichierDefaut, 'w')
f.write(prefixeHTML+stream.getvalue())#.encode(sys.getdefaultencoding()))
f.close()
handler.SaveFile(self.GetBuffer(), nomFichierDefaut)
# stream = io.StringIO()
# if handler.SaveFile(self.GetBuffer(), stream):
# f = open(nomFichierDefaut, 'w')
# f.write(prefixeHTML+stream.getvalue())#.encode(sys.getdefaultencoding()))
# f.close()

elif ext == 'rtf':
# Use the custom RTF Handler
Expand Down

0 comments on commit 5443ae6

Please sign in to comment.