When printing to a pdf file from txt (utf-8 encoding), the following happens:
txt2pdf.py:
from reportlab.platypus import SimpleDocTemplate, Paragraph from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import inch from reportlab.lib.pagesizes import letter def txt2pdf(path): styles = getSampleStyleSheet() styleN = styles['Normal'] story = [] pdf_name = 'pdf.pdf' doc = SimpleDocTemplate( pdf_name, pagesize=letter, bottomMargin=.4 * inch, topMargin=.6 * inch, rightMargin=.8 * inch, leftMargin=.8 * inch) try: txt_file = open(path, 'r') except: print('0') text_content = txt_file.read() P = Paragraph(text_content, styleN) story.append(P) doc.build(story)