Skip to content

Commit

Permalink
wx.metadata/mdlib: fix write output pdf doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Jul 2, 2020
1 parent 91d309d commit f68481f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ def _parseMDOWS(self, md=None):
def savePDF(self, doc, pathToPdf=None):
if pathToPdf is None:
pathToPdf = self.pdf_file
out = open(pathToPdf, 'w+')
out.writelines(doc)
out = open(pathToPdf, 'wb+')
out.write(doc)
out.close()
return pathToPdf

Expand Down
2 changes: 1 addition & 1 deletion grass7/gui/wxpython/wx.metadata/mdlib/mdpdftheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def add_image(self, src, width, height, align=CENTER):
self.add(img)

def render(self):
buffer = io.StringIO()
buffer = io.BytesIO()
doc_template_args = self.theme.doc_template_args()
doc = SimpleDocTemplate(buffer, title=self.title, author=self.author,
**doc_template_args)
Expand Down

0 comments on commit f68481f

Please sign in to comment.