[reportlab-users] TTFError: Can't open "ARIALBD.TTF"

Patrick Sokol psokol at cox.net
Fri Apr 7 02:10:34 EDT 2006


Hopefully i can get some help.  
not really sure what I'm doing - purchased a program called PDF Script Pilot because I would like customer and agents to be able to go online and fill out an applications and generate a PDF.  
Anyway followed the testing directions for the server and all was well.  I've done what the instrcutions in the programed said to do.  
I've put a sample form up on the web and when I went to submit it this is what I got: 
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. 

       /home/cardsok6/public_html/cgi-bin/MakePDF.py  
         25 
     
         26 data = cgi.FieldStorage()
     
         27 form = Form.Form(verbose = 0, pdfpath = filepathname, pdfname = name, pages = pages, empty_fields = 'error.html', load_pdf = 'load.html', directory = directory)
     
         28 if form.CreatePDF(data):
     
         29 #send email with a pdf-file
     
      form undefined, Form = <module 'Form' from 'Form.pyc'>, Form.Form = <class Form.Form>, verbose undefined, pdfpath undefined, filepathname = 'http://www.cardserviceomaha.com/cgi-binMerchantApplication_920389_39926_74723_495449.pdf', pdfname undefined, name = 'MerchantApplication_920389_39926_74723_495449.pdf', pages = [[[8, 'Basic_Merchant_Application_0.png', 0, 0.0, 2.8999999999999999, 612.0, 792.0], [15, 'Text0', [0.0, 0.0, 0.0], 27.800000000000001, 89.400000000000006, 10, 'Arial', 'ARIALBD.TTF', 'Business Name: ', 'Business Name: ', 1], [15, 'Text1', [0.0, 0.0, 0.0], 306.69999999999999, 89.900000000000006, 10, 'Arial', 'ARIALBD.TTF', 'Corporate / Legal Name:', 'Corporate / Legal Name:', 1], [15, 'Text2', [0.0, 0.0, 0.0], 26.399999999999999, 111.5, 10, 'Arial', 'ARIALBD.TTF', 'Business Address:', 'Business Address:', 1], [15, 'Text3', [0.0, 0.0, 0.0], 25.0, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'City:', 'City:', 1], [15, 'Text4', [0.0, 0.0, 0.0], 214.59999999999999, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'State:', 'State:', 1], [15, 'Text5', [0.0, 0.0, 0.0], 256.80000000000001, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Zip Code:', 'Zip Code:', 1], [15, 'Text6', [0.0, 0.0, 0.0], 30.699999999999999, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Area Code:', 'Area Code:', 1], [15, 'Text7', [0.0, 0.0, 0.0], 66.200000000000003, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Phone Number:', 'Phone Number:', 1], [15, 'Text8', [0.0, 0.0, 0.0], 173.80000000000001, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Area Code:', 'Area Code:', 1], [15, 'Text9', [0.0, 0.0, 0.0], 208.30000000000001, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Fax Number:', 'Fax Number:', 1], [15, 'Text10', [0.0, 0.0, 0.0], 307.19999999999999, 111.0, 10, 'Arial', 'ARIALBD.TTF', 'Billing Address:', 'Billing Address:', 1], [15, 'Text11', [0.0, 0.0, 0.0], 306.69999999999999, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'City:', 'City:', 1], [15, 'Text13', [0.0, 0.0, 0.0], 494.89999999999998, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'State:', 'State:', 1], [15, 'Text14', [0.0, 0.0, 0.0], 538.60000000000002, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Zip Code:', 'Zip Code:', 1], [15, 'Text15', [0.0, 0.0, 0.0], 306.19999999999999, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Contact Name:', 'Contact Name:', 1], [15, 'Text16', [0.0, 0.0, 0.0], 312.0, 177.19999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Area Code:', 'Area Code:', 1], [15, 'Text17', [0.0, 0.0, 0.0], 351.80000000000001, 178.69999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Phone Number:', 'Phone Number:', 1], [15, 'Text18', [0.0, 0.0, 0.0], 441.10000000000002, 178.19999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Contact E-mail Address:', 'Contact E-mail Address:', 1], [15, 'Text19', [0.0, 0.0, 0.0], 25.899999999999999, 177.90000000000001, 10, 'Arial', 'ARIALBD.TTF', 'Business Website Address:', 'Business Website Address:', 1], ...], [[8, 'Basic_Merchant_Application_1.png', 0, -1.3999999999999999, 3.6000000000000001, 612.0, 792.0]]], empty_fields undefined, load_pdf undefined, directory = 'http://www.cardserviceomaha.com/cgi-bin' 


       /home/cardsok6/public_html/cgi-bin/Form.py in __init__(self=<Form.Form instance>, **kw={'directory': 'http://www.cardserviceomaha.com/cgi-bin', 'empty_fields': 'error.html', 'load_pdf': 'load.html', 'pages': [[[8, 'Basic_Merchant_Application_0.png', 0, 0.0, 2.8999999999999999, 612.0, 792.0], [15, 'Text0', [0.0, 0.0, 0.0], 27.800000000000001, 89.400000000000006, 10, 'Arial', 'ARIALBD.TTF', 'Business Name: ', 'Business Name: ', 1], [15, 'Text1', [0.0, 0.0, 0.0], 306.69999999999999, 89.900000000000006, 10, 'Arial', 'ARIALBD.TTF', 'Corporate / Legal Name:', 'Corporate / Legal Name:', 1], [15, 'Text2', [0.0, 0.0, 0.0], 26.399999999999999, 111.5, 10, 'Arial', 'ARIALBD.TTF', 'Business Address:', 'Business Address:', 1], [15, 'Text3', [0.0, 0.0, 0.0], 25.0, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'City:', 'City:', 1], [15, 'Text4', [0.0, 0.0, 0.0], 214.59999999999999, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'State:', 'State:', 1], [15, 'Text5', [0.0, 0.0, 0.0], 256.80000000000001, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Zip Code:', 'Zip Code:', 1], [15, 'Text6', [0.0, 0.0, 0.0], 30.699999999999999, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Area Code:', 'Area Code:', 1], [15, 'Text7', [0.0, 0.0, 0.0], 66.200000000000003, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Phone Number:', 'Phone Number:', 1], [15, 'Text8', [0.0, 0.0, 0.0], 173.80000000000001, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Area Code:', 'Area Code:', 1], [15, 'Text9', [0.0, 0.0, 0.0], 208.30000000000001, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Fax Number:', 'Fax Number:', 1], [15, 'Text10', [0.0, 0.0, 0.0], 307.19999999999999, 111.0, 10, 'Arial', 'ARIALBD.TTF', 'Billing Address:', 'Billing Address:', 1], [15, 'Text11', [0.0, 0.0, 0.0], 306.69999999999999, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'City:', 'City:', 1], [15, 'Text13', [0.0, 0.0, 0.0], 494.89999999999998, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'State:', 'State:', 1], [15, 'Text14', [0.0, 0.0, 0.0], 538.60000000000002, 133.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Zip Code:', 'Zip Code:', 1], [15, 'Text15', [0.0, 0.0, 0.0], 306.19999999999999, 155.09999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Contact Name:', 'Contact Name:', 1], [15, 'Text16', [0.0, 0.0, 0.0], 312.0, 177.19999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Area Code:', 'Area Code:', 1], [15, 'Text17', [0.0, 0.0, 0.0], 351.80000000000001, 178.69999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Phone Number:', 'Phone Number:', 1], [15, 'Text18', [0.0, 0.0, 0.0], 441.10000000000002, 178.19999999999999, 10, 'Arial', 'ARIALBD.TTF', 'Contact E-mail Address:', 'Contact E-mail Address:', 1], [15, 'Text19', [0.0, 0.0, 0.0], 25.899999999999999, 177.90000000000001, 10, 'Arial', 'ARIALBD.TTF', 'Business Website Address:', 'Business Website Address:', 1], ...], [[8, 'Basic_Merchant_Application_1.png', 0, -1.3999999999999999, 3.6000000000000001, 612.0, 792.0]]], 'pdfname': 'MerchantApplication_920389_39926_74723_495449.pdf', 'pdfpath': 'http://www.cardserviceomaha.com/cgi-binMerchantApplication_920389_39926_74723_495449.pdf', 'verbose': 0}) 
        100                         self.fonts[object[tb_font_name]] = object[tb_font_file_name]
     
        101             for font in self.fonts:
     
        102                 pdfmetrics.registerFont(TTFont(font, self.fonts[font]))
     
        103 
     
        104     def __get_standart_font(self, font):
     
      global pdfmetrics = <module 'reportlab.pdfbase.pdfmetrics' from 'reportlab/pdfbase/pdfmetrics.py'>, pdfmetrics.registerFont = <function registerFont>, global TTFont = <class reportlab.pdfbase.ttfonts.TTFont>, font = 'Arial', self = <Form.Form instance>, self.fonts = {'Arial': 'ARIALBD.TTF'} 


       /home/cardsok6/public_html/cgi-bin/reportlab/pdfbase/ttfonts.py in __init__(self=<reportlab.pdfbase.ttfonts.TTFont instance>, name='Arial', filename='ARIALBD.TTF', validate=0) 
        947         """ 
     
        948         self.fontName = name 
     
        949         self.face = TTFontFace(filename, validate=validate) 
     
        950         self.encoding = TTEncoding() 
     
        951         self._multiByte = 1     # We want our own stringwidth 
     
      self = <reportlab.pdfbase.ttfonts.TTFont instance>, self.face undefined, global TTFontFace = <class reportlab.pdfbase.ttfonts.TTFontFace>, filename = 'ARIALBD.TTF', validate = 0 


       /home/cardsok6/public_html/cgi-bin/reportlab/pdfbase/ttfonts.py in __init__(self=<reportlab.pdfbase.ttfonts.TTFontFace instance>, filename='ARIALBD.TTF', validate=0) 
        870         "Loads a TrueType font from filename." 
     
        871         pdfmetrics.TypeFace.__init__(self, None) 
     
        872         TTFontFile.__init__(self, filename, validate=validate) 
     
        873  
     
        874     def getCharWidth(self, code): 
     
      global TTFontFile = <class reportlab.pdfbase.ttfonts.TTFontFile>, TTFontFile.__init__ = <unbound method TTFontFile.__init__>, self = <reportlab.pdfbase.ttfonts.TTFontFace instance>, filename = 'ARIALBD.TTF', validate = 0 


       /home/cardsok6/public_html/cgi-bin/reportlab/pdfbase/ttfonts.py in __init__(self=<reportlab.pdfbase.ttfonts.TTFontFace instance>, file='ARIALBD.TTF', charInfo=1, validate=0) 
        392         the font is large.  See TTFontFile.extractInfo for more information. 
     
        393         """ 
     
        394         TTFontParser.__init__(self, file, validate=validate) 
     
        395         self.extractInfo(charInfo) 
     
        396  
     
      global TTFontParser = <class reportlab.pdfbase.ttfonts.TTFontParser>, TTFontParser.__init__ = <unbound method TTFontParser.__init__>, self = <reportlab.pdfbase.ttfonts.TTFontFace instance>, file = 'ARIALBD.TTF', validate = 0 


       /home/cardsok6/public_html/cgi-bin/reportlab/pdfbase/ttfonts.py in __init__(self=<reportlab.pdfbase.ttfonts.TTFontFace instance>, file='ARIALBD.TTF', validate=0) 
        209         # Open the file 
     
        210         if type(file) is StringType: 
     
        211             self.filename, file = TTFOpenFile(file) 
     
        212         else: 
     
        213             self.filename = '(ttf)' 
     
      self = <reportlab.pdfbase.ttfonts.TTFontFace instance>, self.filename undefined, file = 'ARIALBD.TTF', global TTFOpenFile = <function TTFOpenFile> 


       /home/cardsok6/public_html/cgi-bin/reportlab/pdfbase/ttfonts.py in TTFOpenFile(fn='ARIALBD.TTF') 
        196                     f = open_for_read(tfn,'rb') 
     
        197                     return tfn, f 
     
        198         raise TTFError('Can\'t open file "%s"' % fn) 
     
        199  
     
        200 class TTFontParser: 
     
      global TTFError = <class reportlab.pdfbase.ttfonts.TTFError>, fn = 'ARIALBD.TTF' 


TTFError: Can't open file "ARIALBD.TTF" 
      __doc__ = 'TrueType font exception' 
      __getitem__ = <bound method TTFError.__getitem__ of <reportlab.pdfbase.ttfonts.TTFError instance>> 
      __init__ = <bound method TTFError.__init__ of <reportlab.pdfbase.ttfonts.TTFError instance>> 
      __module__ = 'reportlab.pdfbase.ttfonts' 
      __str__ = <bound method TTFError.__str__ of <reportlab.pdfbase.ttfonts.TTFError instance>> 
      args = ('Can\'t open file "ARIALBD.TTF"',) 



I have no Idea what I'm doing - If some one could lead me in the right direction that would be great.

Also is there  someone who can just do this for me - that is get the form and pdf part working properly - please let me know and we can work something out. 

Patrick 

Patrick J. Sokol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://two.pairlist.net/pipermail/reportlab-users/attachments/20060407/26124ffc/attachment-0001.html


More information about the reportlab-users mailing list