ページの操作| C ++ APIソリューション

XPSドキュメントにページを追加します

XPSドキュメントは、1つ以上のページで構成できます。 C ++のAspose.Pageを使用すると、他のソフトウェアの要件なしにXPSドキュメントにページを追加できます。

ページを追加します

XPSDocumentクラスは、メソッドを公開してXPSドキュメントにページを追加します。 XPSドキュメントにページを追加するには、次の手順を使用します。

  1. XPSDocumentクラスのオブジェクトを作成します。
  2. アドページまたは 挿入ページメソッドを使用して、ドキュメントのページのコレクションに新しいページを追加する
  3. saveメソッドを使用してドキュメントを保存します。
 1For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-C
 2// Create new XPS Document
 3auto doc = System::MakeObject<XpsDocument>(dataDir() + u"Sample1.xps");
 4
 5// Add empty page at end of pages list
 6doc->AddPage();
 7// Insert an empty page at beginning of pages list
 8doc->InsertPage(1, true);
 9
10// Save resultant XPS document
11doc->Save(outDir() + u"AddPages_out.xps");

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.