The best solution depends on the architecture of a document ... I have similar problem long time ago making printpreview and printing where should be a header and footer and data that have to be print may be more than one page. I used a list of "frames" where each frame can have child frames and so on. Each frame on list represent item you would like to draw on a page. Then printing algorithm was something like that:

1. Set the iterator/pointer of items to be printed on the first element of the list.
2. If we are on the beggining of the page than insert header here.
3. Knowing size of page and footer .. print each consecutive item from the list that fits in the space between header and footer.
4. Draw footer.

Than do the same on each page starting from point 2. printng rest of the items from the list.


This kind of solution will always give you psibility to print in any format A4,A3,A2.
If you still have same place between last printed item and footer but not big enough to print whole thing you may print clipping it and contiunue on next page ... it simply depends how you would like to print it.

Maybe it is not very nice solution for dynamic pages (where you have to edit thinks on page ... however I think it is still possible to do - probably there exsits better way to do it)

This is solution if you use page based edtion ... like in text processor.
If you use big plane for editing like vector drawing programs (inkscape/corel) than I do not recomend this solution.

You may use also decorator pattern. Which may be more suitable for your current priting model - I strongly suggest to get familiar with this approach at first place.