Untitled

mail@pastecode.io avatar
unknown
python
6 months ago
391 B
5
Indexable
Never
from PyPDF2 import *

output = PdfWriter()
input1 = PdfReader(open("C:\\Users\\LanBui\\Downloads\\Finger Phonics_5.pdf", "rb"))

# add page 1 from input1 to output document, unchanged
output.add_page(input1.pages[0])

output.add_page(input1.pages[3])
output.add_page(input1.pages[5])

with open("a.pdf", "wb") as outputStream:
    output.write(outputStream)
outputStream.close()