在 XPS 文件中使用页面 | Java

Contents
[ Hide Show ]

添加页面

Aspose.Page for Java 提供 XpsDocument 类,该类公开了 setInsertPage() 方法,可用于将页面添加到 XPS 文档。以下代码片段展示了将页面添加到 XPS 文档的完整功能:

 1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir();
 4
 5// Create new XPS Document
 6XpsDocument doc = new XpsDocument(dataDir + "Aspose.xps");
 7
 8// Insert an empty page at beginning of pages list
 9doc.insertPage(1, true);
10
11// Save resultant XPS document
12doc.save(dataDir + "AddPages_out.xps");

请参阅 .NETC++ 中关于在 XPS 文档中使用页面的说明。


您可以从 GitHub下载示例和数据文件。

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.