Found: it seems a problem with 32 bit png files. When converted to 24 bit, pdf rendering was ok. Thank you.
Il giorno giovedì 29 novembre 2012 13:45:08 UTC+1, José Luis Redrejo Rodríguez ha scritto: > > Hi Carlo > I'm using fpdf without any problem, so I guess the reason is in some of > the data you're passing to fpdf. > The code of the controller would be needed to can lend you a hand. > > Regards > > > 2012/11/29 carlo <syse...@gmail.com <javascript:>> > >> No error with web2py 1.9.4. >> >> With 2.2.1 I got this with Python 2.5 and Python 2.6 >> >> >> Traceback (most recent call last): >> File "C:\Python25\web2py\gluon\restricted.py", line 212, in restricted >> >> >> exec ccode in environment >> File "C:/Python25/web2py/applications/Hcontrol/controllers/default.py" >> <http://127.0.0.1:8000/admin/default/edit/Hcontrol/controllers/default.py>, >> line 1000, in <module> >> >> >> File "C:\Python25\web2py\gluon\globals.py", line 188, in <lambda> >> >> >> self._caller = lambda f: f() >> >> >> File "C:/Python25/web2py/applications/Hcontrol/controllers/default.py" >> <http://127.0.0.1:8000/admin/default/edit/Hcontrol/controllers/default.py>, >> line 558, in pdf_prev >> >> >> pdf.add_page() >> File "C:\Python25\web2py\gluon\contrib\fpdf\fpdf.py", line 284, in add_page >> >> >> self.header() >> File "C:/Python25/web2py/applications/Hcontrol/controllers/default.py" >> <http://127.0.0.1:8000/admin/default/edit/Hcontrol/controllers/default.py>, >> line 540, in header >> >> >> self.image(logo,10,8,50) >> >> >> File "C:\Python25\web2py\gluon\contrib\fpdf\fpdf.py", line 896, in image >> >> >> info=self._parsepng(name) >> >> >> File "C:\Python25\web2py\gluon\contrib\fpdf\fpdf.py", line 1749, in >> _parsepng >> >> >> color += re.sub('(.{3}).',lambda m: m.group(1),line, flags=re.DOTALL) >> >> TypeError: sub() got an unexpected keyword argument 'flags' >> >> -- >> >> >> >> > > --