On the document itself, you should make sure that the 'Margin top' property is big enough so that the header (with its own margin property) will fit. The relevant documentation can be found at https://world.mendix.com/display/refguide4/Header+%28document+template%29 and https://world.mendix.com/display/refguide4/Document+Template
Note the PPI value, default set to 120PPI (Pixels per Inch), the margins are in inches so you can calculate how much margin your header needs if you know the height of the header in inches or pixels.