I've uploaded a PDF using PyPDF2. Here's my code:
PageNo=list(range(0,pfr.numPages))
for i in PageNo:
pg = writer.addPage(i)
PageNo creates a list of all the page numbers and I'm trying to add each page from the list into a new PDF, but when I run this script, I'm getting 'int' object is not subscriptable. I know it's an error in my for loop, and I'm sure it's obvious, but any insight on my mistake above would be appreciated.
Thanks!
Edit - here's the solution:
for i in list(range(0,pfr.numPages))
pg = pfr.getPage(i)
writer.addPage(pg)