分节符后页面重新启动

时间:2019-02-19 23:16:48

标签: c# sdk openxml

在分节符之后,目录中的页码将重置为1。如何继续上一页的编号?当我在Word文档中从横向切换为纵向时,会发生这种情况。

        Paragraph paragraph4 = new Paragraph();

        ParagraphProperties paragraphProperties2 = new ParagraphProperties();

        SectionProperties sectionProperties2 = new SectionProperties();

        PageSize pageSize2 = new PageSize() { Width = (UInt32Value)15840U, Height = (UInt32Value)12240U, Orient = PageOrientationValues.Landscape };
        PageMargin pageMargin2 = new PageMargin() { Top = 1440, Right = (UInt32Value)1440U, Bottom = 1440, Left = (UInt32Value)1440U, Header = (UInt32Value)720U, Footer = (UInt32Value)720U, Gutter = (UInt32Value)0U };
        Columns columns2 = new Columns() { Space = "720" };
        DocGrid docGrid2 = new DocGrid() { LinePitch = 360 };

        sectionProperties2.Append(pageSize2);
        sectionProperties2.Append(pageMargin2);
        sectionProperties2.Append(columns2);
        sectionProperties2.Append(docGrid2);

        paragraphProperties2.Append(sectionProperties2);

        paragraph4.Append(paragraphProperties2);
        return paragraph4;

0 个答案:

没有答案