Python での PDF ファイルの特定のページの取得

Contents
[ ]

Aspose.PDF Java for Python を使用して PDF ドキュメントの特定のページを取得するには、GetPage クラスを呼び出してください。

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

# get the page at particular index of Page Collection
pdf_page = pdf.getPages().get_Item(1)

# create a new Document object
new_document = self.Document()

# add page to pages collection of new document object
new_document.getPages().add(pdf_page)

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

print "Process completed successfully!

実行コードをダウンロード

Get Page (Aspose.PDF) を以下のいずれかのソーシャルコーディングサイトからダウンロードしてください。