Hello!
I'm writing an app, which results with pdf file with some text with unicode
characters. On local GAE it works good, but after deploy it can't import
crash after add_font() (pyfpdf).
The code is:
# -*- coding: utf-8 -*-
def fun1():
from gluon.contrib.pyfpdf import FPDF, HTMLMixin
class MyFPDF(FPDF, HTMLMixin):
pass
pdf =MyFPDF()
pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
pdf.add_page()
pdf.set_font('DejaVu','',16)
pdf.write(10,'testąśł')
response.headers['Content-Type']='application/pdf'
return pdf.output(dest='S')
The font files (with a file *DejaVuSansCondensed.pkl* generated after first
run on web2py server...) is in /gluon/contrib/fpdf/font. I didn't add
anything to routers.py (I'm using Pattern-based system) also app.yaml is
not changed.
As I said on local (both web2py and gae) it works well. After deploy only
something like this works:
pdf =MyFPDF()
pdf.add_page()
pdf.set_font('Arial','',16)
pdf.write(10,'testąśł')
But without "unusual" characters...
The best solution would be to add my font files (like DejaVu), but
basically I need unicode characters in any font... maybe some
"half-solution" to use "generic GAE unicode" fonts... if it exist something
like this...
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.