zoukankan      html  css  js  c++  java
  • Aspose.Words .NET如何实现文档合并的同页分页显示

    当我们需要将一个文档添加到另一个文档时,经常会有不同的显示需求。为了文档的流畅,我们需要源文档和目标文档在内容上实现连续显示;而为了更好地区分文档,我们经常会希望两个文档的合并实现分页显示。

           下面,就让我们给出具体实例来对Aspose.Words .NET 的同页分页显示功能进行一个深入的了解:


    一、同页连续显示


    1、代码:

    C#

    Document dstDoc = new Document(gDataDir + "TestFile.Destination.doc");
    Document srcDoc =  new Document(gDataDir + "TestFile.Source.doc");

    // Make the document appear straight after the destination documents content.
    srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.Continuous;

    // Append the source document using the original styles found in the source document.
    dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
    dstDoc.Save(gDataDir + "TestFile.JoinContinuous Out.doc");

    二、另起一页显示

    1、代码:

    C#

     Document dstDoc = new Document(gDataDir + "TestFile.Destination.doc");
    Document srcDoc =  new Document(gDataDir + "TestFile.Source.doc");

    // Set the appended document to start on a new page.
    srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.NewPage;

    // Append the source document using the original styles found in the source document.
    dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
    dstDoc.Save(gDataDir + "TestFile.JoinNewPage Out.doc");

  • 相关阅读:
    出差常熟,郁闷中 沧海
    ABAP中程序之间传递参数的办法 沧海
    LSMW中出现No logical path specified. 沧海
    请认真对待生活 沧海
    escape sequence 沧海
    休假一周 沧海
    Print Program and Form Modify 沧海
    下周回南京 沧海
    LO020真麻烦 沧海
    函数讲解函数列表(ZT) 沧海
  • 原文地址:https://www.cnblogs.com/sxhlf/p/6709961.html
Copyright © 2011-2022 走看看