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

下面,就让我们给出具体实例来对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");

最新文章

  1. 如何让NGUI的对象在3D模型之上
  2. 【codevs1044】导弹拦截问题与Dilworth定理
  3. TeamViewer“试用期已到期”解决方法
  4. Android ActionBarSherlock使用教程
  5. [CSS]元素的显示与隐藏
  6. MVC 小常识
  7. 一个很好的php分词类库
  8. HDU 2222 (AC自动机模板题)
  9. MYSQL启用日志,查看日志,利用mysqlbinlog工具恢复MySQL数据库【转载】
  10. Android控件系列之RadioButton&RadioGroup
  11. 【译】MongoDb vs Mysql—以NodeJs为例
  12. Java面试题[转载]
  13. 如何创建自己的composer包
  14. Confluence 6 跟踪你安装中的自定义修改
  15. Linux服务部署--Java(二)
  16. angular+webpack(二)
  17. 修改sga_max_size大小后重启数据库报 ORA-00851
  18. MySQL的自动补全和语法高亮工具MyCli
  19. ArcGIS自定义工具箱-自增字段(可以设置初始值和步长)
  20. Screen、IP

热门文章

  1. 进阶Kotlin-常见关键字
  2. kali linux之主动信息收集(三层发现,四层发现)
  3. leecode刷题(2)-- 买卖股票的最佳时机
  4. luoguP2664 树上游戏
  5. spark执行例子eclipse maven打包jar
  6. 如果将markdown视作一门编程语言可以做哪些有趣的事情?
  7. 如何让ie8地址栏下拉框里不显示历史记录和收藏夹
  8. 安装GCC-8.3.0及其依赖
  9. 利用EFCore 封装Repository(可扩展不同数据的sql操作)
  10. C++_语法知识点大纲