Python での PDFファイルの個別ページへの分割
Contents
[
Hide
]
Aspose.PDF Java for PHP を使用して PDF ドキュメントを個別ページに分割するには、単に SplitAllPages クラスを呼び出すだけです。
pdf = self.Document()
pdf=self.dataDir + 'input1.pdf'
# loop through all the pages
pdf_page = 1
total_size = pdf.getPages().size()
while (pdf_page <= total_size):
# create a new Document object
new_document = self.Document();
# get the page at particular index of Page Collection
new_document.getPages().add(pdf.getPages().get_Item(pdf_page))
# save the newly generated PDF file
new_document.save(self.dataDir + "page_#{$pdf_page}.pdf")
pdf_page+=1
print "Split process completed successfully!";
コードの実行をダウンロード
Download Split Pages (Aspose.PDF) から、以下に記載されたソーシャルコーディングサイトのいずれかからダウンロード: