13

嗨,我在 MigraDoc 中制作了一个大表格,当表格太大而无法在页面上显示时,它会自动拆分表格。我在页眉中有一个徽标,当它进入第 2 页时,我的表格位于徽标上方并且没有进入。任何人都知道如何确保它在移动到其他页面时发生故障?

这是徽标代码。就像他们在发票中的例子

        Image image = section.Headers.Primary.AddImage("H-Logo900x700.png");
        image.Height = "2.5cm";
        image.LockAspectRatio = true;
        image.RelativeVertical = RelativeVertical.Line;
        image.RelativeHorizontal = RelativeHorizontal.Margin;
        image.Top = ShapePosition.Top;
        image.Left = ShapePosition.Right;
        image.WrapFormat.Style = WrapStyle.Through;
4

3 回答 3

24

抱歉回答延迟..ThomasH 说的是正确的,您应该为页眉和页脚(顶部和底部边距)预留空间以防止重叠。边距必须大于在您的案例中添加到它的项目(页眉或页脚) . 如果您的标题(图片)约为。2.5cm 你必须设置

Section.PageSetup.TopMargin= Unit.FromCentimeter(3.0) 标题

Section.PageSetup.BottomMargin= Unit.FromCentimeter(3.0) 对于页脚

..我希望你有添加部分。

于 2014-09-19T06:48:55.503 回答
14

PageSetup 为页眉和页脚(顶部和底部边距)保留空间。您有责任使边距足够大以防止标题和内容之间的重叠。

或者换句话说:如果你想要这样的话,标题和内容可以重叠。

于 2014-05-31T07:16:12.193 回答
2

文档文档 = 新文档();
Section section = document.AddSection();

For Header: Section.PageSetup.TopMargin= "1cm"; // 根据图片高度

For Footer: Section.PageSetup.BottomMargin= "1cm"; // 根据图片高度

于 2017-08-28T21:04:09.853 回答