resolved pdf out-of-memory issue
php zipfile#addFromString was causing the leak, we now write to tempfiles
and use zip#addFile which keeps memory usage flat
Refactor pdf memory issue changes for clarity and consitency.
Removed what appears to be unecessary ememory manamgement now that zip archive has been identified as the problem with PDF archives.