I get a top and bottom margin of about an inch and the header/footer content that doesn’t fit is truncated. If I set a height for the top and bottom margins that space is allocated even if the header/footer content are one line resulting in a lot of wasted space on the page. And if the content exceeds the specified height the content is truncated. Ideally I’d like the height of the header/footer to reflect the height of the content being placed in them.
At the moment no, the height of the page top/bottom margin can't be determined by the content that is displayed there. One workaround if your document has only a few pages is to use "float: top" and "float: bottom" to float the content to the top and bottom of the page box instead of the page margins. This can't create repeating headers/footers though. Another option is to put the content inside a table and use <thead> and <tfoot> elements to create a table header/footer, as these will be repeated on each page.
We are using the float: bottom; as you suggested to place a footer at the bottom for each document (not bottom of every page) included in the PDFs we generate using version 7.2 devel. We need to support dynamic header and footer heights, because we allow our clients to include their logos and custom text.
This solution works except in the case where the last page of the document fills up most of the page. When the footer is applied to the page the content overlaps. Any suggestions on how to solve this problem? I'd be happy to e-mail a sample.