This may be a bit of a detour, but Tim Dietrich wrote a helpful post on how to
Use SuiteScript to Generate Highly Customized Transaction PDFs . Rather than rendering programmatically, you "inject dynamically generated XML context" into a PDF template. In the article, he says the approach allows printing transactions in bulk.