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.
|