I would like to somehow generate hundreds of PDFs (with embedded images) from a VF Page / custom controller. This requirement is part of a bigger package that is already using a lot of SOQL calls.
I'm not sure such a thing is even possible, but....
I would like to issue the necessary SOQL first (outside of the VF context), and then instantiate the VF pages in a loop through the list of records returned by the single SOQL call.
In the loop, each individual VF page instantiation would somehow be passed the specific data used in the VF Page. The loop would finish by saving the generated content (getContentAsPDF) as an attachment on a custom object. I don't need to actually show anything on the VF Page.
I won't be able to query the data using SOQL in the controller itself without exceeding governor limits - I would like to pass in the values somehow - perhaps by setting controller class member variables (lists).
I don't see any way to access an instantiated VF Page's associated custom controller object instance. Nor do I see a way to associate a new VF Page instance with a previously instantiated custom controller object.
I have used Blob methods in the past for this kind of thing, but that approach doesn't work with graphics - the styling of the VF page is what I'm after, without having to issue SOQL calls in the controller for each instantiation of the VF page when 100s (or 1000s) are needed....
Is such a thing even possible?