XPS ファイルのページ操作 | Python

Contents
[ Hide Show ]

XPS ドキュメント内のページ管理には、個々のページの追加、削除、並べ替え、アクセスなどのタスクが含まれます。

ページの追加

Aspose.Page for Python via .NET は、XPS ドキュメントにページを追加するための set_insert_page() メソッドを含む XpsDocument クラス を提供します。次のコード スニペットは、このメソッドを使用して XPS ドキュメントにページを追加する方法を示しています。

 1# The path to the documents directory.
 2data_dir = Util.get_data_dir_working_with_pages()
 3# Create a new XPS Document
 4doc = XpsDocument(data_dir + "Sample1.xps")
 5
 6# Insert an empty page at the beginning of the pages list
 7doc.insert_page(1, True)
 8
 9# Save the resultant XPS document
10doc.save(data_dir + "AddPages_out.xps")

XPS は、 .NETJavaC++ 経由で文書化されます。


サンプルとデータ ファイルは GitHub からダウンロードできます。

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.