[reportlab-users]
renderPM 'module'object hasno attribute 'saveToFile'
Robin Becker
robin at reportlab.com
Wed Jul 12 09:50:34 EDT 2006
Genís Pujol wrote:
> Hi,
>
> I'm getting more output now. Seems that, among other things, it needs the Times-Roman font, which doesn't come by default with reportlab.
>
> Output:
>
> SLED10:~ # python reportlab.test
> Traceback (most recent call last):
> File "reportlab.test", line 11, in ?
> d.save(formats=['png'],outDir='/tmp',fnRoot='example1')
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/shapes.py", line 689, in save
> renderPM.drawToFile(self, filename,fmt=bmFmt,showBoundary=getattr(self,'showBorder',rl_config.showBoundary),**_extraKW(self,'_renderPM_',**kw))
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 591, in drawToFile
> c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 577, in drawToPMCanvas
> draw(d, c, 0, 0, showBoundary=showBoundary)
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 49, in draw
> R.draw(renderScaledDrawing(drawing), canvas, x, y, showBoundary=showBoundary)
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderbase.py", line 200, in draw
> self.initState(x,y) #this is the push()
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 86, in initState
> self.applyState()
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 80, in applyState
> self._canvas.setFont(s['fontName'], s['fontSize'])
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 358, in setFont
> _setFont(self._gs,fontName,fontSize)
> File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 238, in _setFont
> raise RenderPMError, "Can't setFont(%s) missing the T1 files?\nOriginally %s: %s" % (fontName,s1,s2)
> reportlab.graphics.renderPM.RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
> Originally exceptions.TypeError: makeT1Font() argument 2 must be string, not None
>
>
> Regards,
>
> Genis.
>
...... you need to get hold of the standard Adobe pfb files. Look for pfbfer.zip
in http://www.reportlab.org/ftp
--
Robin Becker
More information about the reportlab-users
mailing list