I have several chunks of verbatim text, each of which should be placed on a separate page (and nothing else). The page size should be determined to tightly fit the largest of the chunks, while all the other chunks should just as usual start in the top-left corner and go as far as they go. The chunks can vary in their vertical and horizontal sizes and their number, and I don't know which one is the largest.
Is there a way to automatically set the required page size from within Latex?
As I'm assuming that this is NOT possible - are there any suggestions on how to do that from outside? I'm generating the chunks in Java, so I could also create a Latex header for the correct page dimensions. But what would be a good way to do that (which document class/packages would suit best (something with geometry, probably...))? The size itself should be easy to claculate as the font in Latex has fixed character size.
(I know the requirement is a little strange, but that's exactly what I need. I'd obviously prefer a Latex-only solution if there is one...)