Delete a Particular Page from the PDF File in Python

Contents
[ ]

To delete a Particular Page from the PDF document using Aspose.PDF Java for Python, simply invoke DeletePage class.


doc= self.Document()
pdf = self.Document()
pdf=self.dataDir + 'input1.pdf'

# delete a particular page
pdf.getPages().delete(2)

# save the newly generated PDF file
doc.save(self.dataDir + "output.pdf")

print "Page deleted successfully!"

Download Running Code

Download Delete Page (Aspose.PDF) from any of the below mentioned social coding sites: