在 XPS 文件中使用页面 | .NET
Contents
[
Hide
Show
]向 XPS 文档添加页面
Aspose.Page for .NET 提供了 XpsDocument 类,该类公开了 InsertPage 方法,可用于向 XPS 文档添加页面。 以下代码片段展示了向 XPS 文档添加页面的完整功能:
1// Add page to XPS document.
2
3// Create new XPS Document
4XpsDocument doc = new XpsDocument(DataDir + "Sample1.xps");
5
6string outputFileName = "AddPages_out.xps";
7
8// Insert an empty page at beginning of pages list
9doc.InsertPage(1, true);
10
11// Save resultant XPS document
12doc.Save(OutputDir + outputFileName);
您可以从 GitHub下载示例和数据文件。