📅  最后修改于: 2022-03-11 14:50:36.585000             🧑  作者: Mango
pip install pikepdf
# Elegant, Pythonic API
with pikepdf.open('input.pdf') as pdf:
num_pages = len(pdf.pages)
del pdf.pages[-1]
pdf.save('output.pdf')