[reportlab-users] Experimental early serializing pdfdoc.py for

Robin Becker robin at reportlab.com
Thu Apr 14 13:30:36 EDT 2005


Thomas Blatter wrote:
> Hi,
> 
> 
>>I can now run all the rml2pdf tests OK, but even though the main documentation 
>>runs to completion I have problems reading the resultant PDF.
> 
> 
> What kind of problems ? I found ghostview more helpful (but not a lot) than acrobat to check for errors. Best for me always was comparing the resulting PDFs (new/old pdfdoc.py) in normal text editor.
> 

well I was getting malformed PDF from the rml2pdf generation script. I've now 
traced the cause of that and it was caused by rml2pdf opening the output file 
twice without closing in between. At some point some garbage was being writtent 
from the first pass into the result for the second.

The way to fix that is to force close ie doc.canv._doc.File.close() if we're 
going round again.

> 
>>As for the overall API can you explain why we need to stage to _pdfdata in the 
>>format methods? Why don't we call format directly etc etc?
> 
> 
> Not needed any more, that was with clean(), in case one needs to inline again a cleaned object.
> 
> Thomas Blatter
.... OK; do you feel able to hack that out or have you done enough?

If we get a clean implementation we can allow for both in memory and on disk 
PDFDocs with fairly minimal changes to the rest of reportlab. For small jobs 
it's probably faster to be in memory; for large runs it makes sense to work onto 
disk.
-- 
Robin Becker


More information about the reportlab-users mailing list