[reportlab-users] Broken code

Robin Becker reportlab-users@reportlab.com
Mon, 8 Sep 2003 23:53:22 +0100


In article <20030908204842.9A47F78864@mail.broadpark.no>, post@nlhas.no
writes
>Is anybody able to help with this one? Attempting to run code that has run 
>perfectly for over a year on our previous box (probably with a previous version 
>of Reportlab), fails on a fresh install with the latest version (downloaded in 
>the course of a long weekend rebuilding the server...!).
>
>Traceback (see foot for full version):
>
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 1839, in format
>    dict["Filter"] = PDFArray(map(PDFName,self._filters))
>AttributeError: PDFImageXObject instance has no attribute '_filters'
>
>Any help would be most appreciated.
>
hi, we've not moved to 2.3 in any great weight yet so this could be of
use. Do you have a minimal example that gives this error? Can you run
with the same code and Python-2.2.3?
>Rgds
>
>Paul Mothersdill
>
>
>
>The document is a SimpleDocTemplate with a header and flowed body text -- in 
>simplified form:
>
>
>    doc = SimpleDocTemplate(_filename)
>    doc.rightMargin = 40
>    doc.showBoundary = 0
>    doc.leftMargin = 40
>    doc.topMargin = 40
>    doc.bottomMargin = 40   
>    data=  [[B , A]] # predefined lists of objects, including a gif logo & text
>    t=Table(data, colWidths=(330,175) ,
>            style=[('VALIGN' ,(0,0),(-1,-1) , 'TOP'),
>            ('LINEBELOW',(0,-1),(-1,-1),2,colors.black)])
>    # stuff to flow in the body text (approx 20 lines).
>    doc.build(docflow, onFirstPage=makePage, onLaterPages=makePage)
>
>
>def makePage(canvas, doc):
>    canvas.saveState()
>    canvas.setFont('Courier-Bold',16)
>    canvas.restoreState()
>  
>
>Full traceback:
>
>  File "/home/public/nlh/nlhapp/utils/message/makefax.py", line 123, in makefax
>    doc.build(docflow, onFirstPage=makePage, onLaterPages=makePage)
>  File "/usr/local/lib/python2.3/site-packages/reportlab/platypus/doctemplate.py
>", line 765, in build
>    BaseDocTemplate.build(self,flowables)
>  File "/usr/local/lib/python2.3/site-packages/reportlab/platypus/doctemplate.py
>", line 611, in build
>    self._endBuild()
>  File "/usr/local/lib/python2.3/site-packages/reportlab/platypus/doctemplate.py
>", line 585, in _endBuild
>    if getattr(self,'_doSave',1): self.canv.save()
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfgen/canvas.py", line 
>818, in save
>    self._doc.SaveToFile(self._filename, self)
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 230, in SaveToFile
>    f.write(self.GetPDFData(canvas))
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 250, in GetPDFData
>    return self.format()
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 373, in format
>    IOf = IO.format(self)
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 722, in format
>    fcontent = format(content, document, toplevel=1) # yes this is at top level
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 96, in format
>    f = fmt(document)
>  File "/usr/local/lib/python2.3/site-packages/reportlab/pdfbase/pdfdoc.py", 
>line 1839, in format
>    dict["Filter"] = PDFArray(map(PDFName,self._filters))
>AttributeError: PDFImageXObject instance has no attribute '_filters'
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users
>

-- 
Robin Becker