Lavorare con le pagine in un file XPS | Python

Contents
[ Hide Show ]

La gestione delle pagine all’interno di un documento XPS prevede attività come l’aggiunta, la rimozione, la riorganizzazione o l’accesso a singole pagine.

Aggiungere pagine

Aspose.Page per Python tramite .NET fornisce la classe XpsDocument, che include il metodo set_insert_page() per l’aggiunta di pagine a un documento XPS. Il seguente frammento di codice illustra come utilizzare questo metodo per aggiungere pagine a un documento XPS:

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

documenti XPS tramite .NET, Java e C++.


È possibile scaricare esempi e file di dati da GitHub.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.