Untitled

mail@pastecode.io avatar
unknown
python
a month ago
425 B
5
Indexable
Never
from PyPDF2 import PdfFileWriter
from PyPDF2 import PdfFileReader
 
import os
output = PdfFileWriter()
input1 = PdfFileReader(open("Roblox.pdf", "rb"))
 
# add page 1 from input1 to output document, unchanged
output.addPage(input1.getPage(0))
 
output.addPage(input1.getPage(3))
output.addPage(input1.getPage(5))
 
 
with open("a.pdf","wb") as outputStream:
    output.write(outputStream)
outputStream.close()
Leave a Comment