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

Genís Pujol genis.pujol at mss.scc.com
Wed Jul 12 10:18:25 EDT 2006


Cool it's working now! Thank you very much!

Genís


-----Original Message-----
From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Robin Becker
Sent: miércoles, 12 de julio de 2006 15:51
To: Support list for users of Reportlab software
Subject: Re: [reportlab-users]renderPM 'module'object hasno attribute 'saveToFile'

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
_______________________________________________
reportlab-users mailing list
reportlab-users at reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users


More information about the reportlab-users mailing list