[reportlab-users] Experimental early serializing pdfdoc.py for
robin at reportlab.com
Thu Apr 14 07:11:19 EDT 2005
Thomas Blatter wrote:
>>Robin Becker wrote:
>>File "c:\code\rlextra\rml2pdf\rml2pdf.py", line 4006, in go
>>if done: doc.canv.save()
>>File "c:\code\reportlab\pdfbase\pdfdoc.py", line 675, in _format
>>File "c:\code\reportlab\pdfbase\pdfdoc.py", line 833, in clean
>>AttributeError: PDFInfoL instance has no attribute 'dict'
>>I don't understand the error. The implication is that this object has already
>>been cleaned (to get rid of its internal state & memory); to get more concrete I
>>guess I would have to abstract the structure that's going wrong here and make it
>>into a canvas based problem.
> Hi Robin,
> PDFInfoL is a PDF object class which is not defined pdfdoc.py but seems to be subclassed (indirectly: propably PDFDictionary) from my new PDFObjectReferable class. The semantics for PDF objects has changed so you might need to adapt to the new semantics. In particular objects which might have forward references need a obj.setForwardReference() call.
> Nevertheless this problem could be fixed now, since actually clean() is not needed (it was a left-over from earlier tries), without clean() i get in the 500 gadflypaper run in all only 80 "garbage" objects more than with the clean() call.
> I posted the new pdfdoc.py w/o clean() as well as a fixed gfe.py without white-pages which produces the expected 5000 pages instead of 19000 (it was an additional Spacer inserted before each iteration).
OK that problem was caused by the PDFInfoL class failing to call the base class
__init__ so we didn't create the dict attribute. After fixing that I see only
one error from the rml2pdf tests it is related to parsing stuff we just produced.
I also thought it should be possible to let things just die naturally. I will
try and have a look at the latest version when I get time.
More information about the reportlab-users