View Single Post
Old 01-18-2009, 04:47 PM   #49
wiffel
Member
wiffel is on a distinguished road
 
Posts: 19
Karma: 72
Join Date: Dec 2008
Device: bebook
If anybody is interested ...

I did implement what I proposed in my previous post. (Save the images and load them later to create the PDF file(s) ). This makes the usage of memory for the conversion of large files a lot less.

The config.lua to do this is attached.

PS: Taesoo Kwon
While implementing this, I did add the LUA collectgarbage a couple of times to make sure that images are garbage collected. I noticed that I did have a lot of crashes while generating the PDF. This makes me think that the PDF structure (used by outpdf:addPage(image)) does not keep a reference to the images that have been added. That could account for the 'random' crashes. Just to be sure, I did add a little list that keeps a reference to the images until the PDF has been created. That way they can not be garbage collected by LUA. That seemed to fix the crashes for me.
Attached Files
File Type: zip config.zip (1.7 KB, 938 views)
wiffel is offline   Reply With Quote