but not much luck... encodings were always hard for me...
but if I try to insert it via cell/multicell, I get stuck ...
if isinstance(text, unicode):
#~ text = text.encode("latin1","ignore")
text = text.encode('utf8')
and explicitly changed all set_font to:
#~ pdf.set_font(font,style,size)
pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
pdf.set_font('DejaVu','',size)
Traceback (most recent call last):
File "unicode_template.py", line 321, in <module>
f.render("./invoice.pdf")
File "unicode_template.py", line 135, in render
self.handlers[element['type'].upper()](pdf, **element)
File "unicode_template.py", line 172, in text
pdf.cell(w=x2-x1,h=y2-y1,txt=text,border=0,ln=0,align=align)
File "/home/nijole/Downloads/pyfpdf/fpdf/fpdf.py", line 632, in cell
txt = self.normalize_text(txt)
File "/home/nijole/Downloads/pyfpdf/fpdf/fpdf.py", line 1043, in normalize_text
txt = txt.decode('utf8')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position 1: invalid start byte