问题
This is a follow up of this other question.
I have an image and text on the header of a PDF document created with MigraDoc. Problem is that content that should be below header is placed over the header partially, hiding part of the header content (they overlap vertically, table starts before header finishes).
How to force a table control to make room to all header content?
回答1:
You have to "protect" your header by setting header position and top margin as needed. It's up to you to determine the height needed for the header or things will overlap if the header grows below the top margin.
In the worst case, create a document with a body consisting of the contents of the header and prepare that document to get the height it needs.
Then create the final document with the header and set the top margin according to the height you determined with the first document.
来源:https://stackoverflow.com/questions/32983060/how-to-make-room-for-the-header-on-pdf-document