Well, let’s imagine you need to convert the current discussion thread to a single page PDF. The only chance to put the content “as is” to a single page is to scale it down to almost invisible sizes of fonts. (That is what pd4ml.fitPageVertically() would do). And it is normal – the thread has already too much content for a single page.

An interactive solution for the “problem” – browser scrollbars. But PDF is paper-output-oriented format. Paper has no scrollbars -> there is no generic solution for the issue – there are content amounts simply do not fit a page.

So I would recommend to consider multi-page PDF output if it is acceptable by your work requirements.

If not, you could try to impact the third-party document layout with external CSS style (pd4ml.addStyle()). The goal is to let the content flow horizontally. The solution will work only if the expected input documents has similar structure and their volume only slightly differs from one doc to another.