[reportlab-users]renderPM 'module'object hasno attribute 'saveToFile'

Robin Becker robin at reportlab.com
Fri Jul 14 14:25:19 EDT 2006


George wrote:
> I had the same problem
> I got for pfbfer.zip and installed thepfb files in C:python23/LIB 
> still have the same problem:
>>>> ================================ RESTART ================================
>>>>
> Warn: Can't find .pfb for face 'Times-Roman'
> 
> Traceback (most recent call last):
>   File "L:\HereAndThere\Stairs\test.py", line 9, in -toplevel-
>     renderPM.drawToFile(drawing, 'example1.gif', 'GIF')
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 559, in drawToFile
>     c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 545, in drawToPMCanvas
>     draw(d, c, 0, 0, showBoundary=showBoundary)
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 49, in draw
>     R.draw(drawing, canvas, x, y, showBoundary=showBoundary)
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderbase.py", line 188, in draw
>     self.initState(x,y)
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 86, in initState
>     self.applyState()
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 80, in applyState
>     self._canvas.setFont(s['fontName'], s['fontSize'])
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 327, in setFont
>     _setFont(self._gs,fontName,fontSize)
>   File "C:\Python23\lib\site-packages\reportlab\graphics\renderPM.py", line 207, in _setFont
>     raise RenderPMError, "Can't setFont(%s) missing the T1 files?\nOriginally %s: %s" % (fontName,s1,s2)
> RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
> Originally exceptions.TypeError: makeT1Font() argument 2 must be string, not None
> Should I have put the pfb files somewhere else?
> 
> george
yes either in reportlab/fonts or in somewhere mentioned on the T1SearchPath 
defined in reportlab/rl_config.py
-- 
Robin Becker


More information about the reportlab-users mailing list