C# 文档页脚注释跳过第一页

C# 文档页脚注释跳过第一页,c#,migradoc,C#,Migradoc,一切进展顺利,直到客户说他希望pdf的第一页作为封面。这意味着第一页应该没有空白,下一页应该没有空白。我从中继承所有导出文件的基类在其构造函数中包含以下内容: public ExportPDF() { this.document = new Document(); this.document.DefaultPageSetup.Orientation = Orientation.Portrait; this.document.Info.Author = GlobalBL.

一切进展顺利,直到客户说他希望pdf的第一页作为封面。这意味着第一页应该没有空白,下一页应该没有空白。我从中继承所有导出文件的基类在其构造函数中包含以下内容:

public ExportPDF()
{
    this.document = new Document();
    this.document.DefaultPageSetup.Orientation = Orientation.Portrait;

    this.document.Info.Author = GlobalBL.AdministratorFullName;
    this.document.FootnoteLocation = FootnoteLocation.BottomOfPage;
    this.document.FootnoteNumberStyle = FootnoteNumberStyle.Arabic;
    this.document.FootnoteStartingNumber = 1;

    this.document.DefaultPageSetup.PageFormat = PageFormat.A4;
    this.document.DefaultPageSetup.TopMargin = "1cm";
    this.document.DefaultPageSetup.BottomMargin = "2cm";
    this.document.DefaultPageSetup.LeftMargin = "1cm";
    this.document.DefaultPageSetup.RightMargin = "1cm";
    this.document.DefaultPageSetup.HeaderDistance = "0cm";
    this.document.DefaultPageSetup.FooterDistance = "0cm";
    this.document.UseCmykColor = false;

    DefineStyles();

    this.section = this.document.AddSection();
}
我注意到,即使我对脚注部分进行了注释,但没有任何变化,我仍然得到了脚注编号。
因此,在这种格式中,所有页面都将获得边距。如果我把它们拿出来,封面看起来很完美,但其余的几页就不行了。但我想在每一件出口商品上,我都可以做缩进之类的事情,我还不知道,也许有人也会有这样的想法……但能不能去掉页码,更重要的是,我怎么能跳过第一页(封面)的编号呢?真希望有人能帮忙。谢谢

脚注就是脚注。我想你的文件中没有使用脚注

页眉和页脚是不同的故事。通常使用页脚添加页码。我想你就是这么做的

在您的情况下,我会做什么:使用一个部分作为封面,并为文档的其余部分创建一个新的部分(document类的AddSection()方法)

无论如何,您都不应该更改DefaultPageSetup。每个部分都有自己的页面设置,因此您可以为封面和文档的其余部分设置不同的页边距