[reportlab-users] How to get renderPM working?...

Peter K. Korsgaard pkk at dmi.dk
Wed Jun 8 06:24:43 EDT 2005


Hi,

Im a newbie of using reportlab.

I packed out the reportlab zip-archive "reportlab_1_20" in "c:\python23\lib"
and
wrote:

 \python23\python.exe setup.py build
 \python23\python.exe setup.py install

in the same way i installed 'renderPM-1.00-daily-win32.zip'

now i run the example:

from reportlab.lib import colors
from reportlab.graphics.shapes import *
d = Drawing(400, 200)
d.add(Rect(50, 50, 300, 100, fillColor=colors.yellow))
d.add(String(150,100, 'Hello World',fontSize=18, fillColor=colors.red))
from reportlab.graphics import renderPDF
renderPDF.drawToFile(d, 'example1.pdf', 'My First Drawing')

it works fine, but when i change the two last lines to following it dont
work and i get the understanding error message, what do i have to
do???......... I need this tool to plot (lat,long) positions at a
geographical map in a 'jpg' or in a 'bmp' -file.

from reportlab.graphics import renderPM
renderPM.drawToFile(d, 'example1.pdf', 'My First Drawing')


error message:
---------------------------------
Traceback (most recent call last):
  File "C:\Documents and Settings\KORSGAARD\Skrivebord\reportla.py", line
10, in ?
    renderPM.drawToFile(d, 'example1.pdf', 'My First Drawing')
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderPM.py
", line 559, in drawToFile
    c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL,
showBoundary=showBoundary)
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderPM.py
", line 545, in drawToPMCanvas
    draw(d, c, 0, 0, showBoundary=showBoundary)
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderPM.py
", line 49, in draw
    R.draw(drawing, canvas, x, y, showBoundary=showBoundary)
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderbase.
py", line 188, in draw
    self.initState(x,y)
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderPM.py
", line 86, in initState
    self.applyState()
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderPM.py
", line 80, in applyState
    self._canvas.setFont(s['fontName'], s['fontSize'])
  File
"C:\Programmer\Plone\Python\lib\site-packages\reportlab\graphics\renderPM.py
", line 327, in setFont
    _setFont(self._gs,fontName,fontSize)
  File
"C:\Programmer\Plone\Python\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
-----------------








More information about the reportlab-users mailing list