[reportlab-users] Re:
renderPM 'module'object hasno attribute 'saveToFile'
Jose
jose.pereira.lopes at cern.ch
Fri Jul 14 11:17:45 EDT 2006
Hello
The type of error you mentioned is caused by not having the correct fonts on
your machine or by renderPM not being able to find them.
On Linux, renderPM needs to know the locations of the following fonts:
AdobeSansMM.MMM.pfb
AdobeSansMM.pfb
AdobeSerifMM.MMM.pfb
AdobeSerifMM.pfb
Arial-BoldItalic.pfb
Arial-Bold.pfb
Arial-Italic.pfb
Arial.pfb
Courier-BoldOblique.pfb
Courier-Bold.pfb
Courier-Oblique.pfb
Courier.pfb
Symbol.pfb
TimesNewRoman-BoldItalic.pfb
TimesNewRoman-Bold.pfb
TimesNewRoman-Italic.pfb
TimesNewRoman.pfb
ZapfDingbats.pfb
These fonts may be downloaded from:
http://bioinf.scri.ac.uk/lp/downloads/programs/genomediagram/linfonts.zip
The locations that ReportLab will look for these fonts are defined in the file
rl_config.py. The relevant part of this file, at the time of writing, looks
like this:
# places to look for T1Font information
T1SearchPath = (
'c:/Program Files/Adobe/Acrobat 6.0/Resource/Font', #Win32,
Acrobat 6
'c:/Program Files/Adobe/Acrobat 5.0/Resource/Font', #Win32,
Acrobat 5
'c:/Program Files/Adobe/Acrobat 4.0/Resource/Font', #Win32,
Acrobat 4
'%(disk)s/Applications/Python %(sys_version)s/reportlab/fonts',
#Mac?
'/usr/lib/Acrobat5/Resource/Font', #Linux, Acrobat 5?
'/usr/lib/Acrobat4/Resource/Font', #Linux, Acrobat 4
'/usr/local/Acrobat6/Resource/Font', #Linux, Acrobat 5?
'/usr/local/Acrobat5/Resource/Font', #Linux, Acrobat 5?
'/usr/local/Acrobat4/Resource/Font', #Linux, Acrobat 4
'%(REPORTLAB_DIR)s/fonts', #special
'%(REPORTLAB_DIR)s/../fonts', #special
'%(REPORTLAB_DIR)s/../../fonts', #special
'%(HOME)s/fonts', #special
)
Placing the font files in any of these locations should be enough to solve the
problem. Otherwise, you may need to edit the rl_config.py file yourself to
specify the appropriate location.
Regards
Jose
More information about the reportlab-users
mailing list