0

I want to create a document that has the footer on the last page only. I came across this SO thread that suggested it can't be done: MigraDoc - only Last Page Footer

Taking the suggestion from that post, I created a TextFrame and added it to the last page at the bottom. The problem now is that other elements overlap the TextFrame.

I've set section.PageSetup.BottomMargin, which works, but it reserves the space for the footer on each page, which I want to avoid.

Strikegently
  • 2,251
  • 20
  • 23

1 Answers1

0

One thing you can do: add one or more empty paragraphs at the end of the document to prevent the overlapping.
One paragraph will do, setting SpaceBefore for that paragraph as needed. You know the BottomMargin, you know the height of the TextFrame and can easily determine the height of the empty paragraph.

If overlapping occurs, the TextFrame will hide empty paragraphs only. The empty paragraphs cause a pagebreak in cases where you now have an overlap of TextFrame and essential contents.

  • Can I force a table to page break after a certain number of rows? My main content is a large table that may span multiple pages. The empty paragraph trick generally works, except when the table is too large to include the "footer" but too small to break into a second page. The page breaks, but I end up with a second page that is nothing but the footer. – Strikegently May 17 '18 at 16:42
  • @Strikegently You can always end a table, add a PageBreak to the document, and then start a new table. That would be a simple solution if all rows have the same height. Is it an option to turn the footer into a final page with some more content, always prefixed with a pagebreak? – I liked the old Stack Overflow May 22 '18 at 08:10