Skip to content

Instantly share code, notes, and snippets.

@jacobkahn
Created March 5, 2019 22:04
Show Gist options
  • Save jacobkahn/d997a0bffa419beb55a655bf2dd133af to your computer and use it in GitHub Desktop.
Save jacobkahn/d997a0bffa419beb55a655bf2dd133af to your computer and use it in GitHub Desktop.
CIS 320 Exam Parser
import uuid
from pyPdf import PdfFileWriter, PdfFileReader
for qq in range(1, 10):
inputpdf = PdfFileReader(open("in" + str(qq) + ".pdf", "rb"))
j = -1
for i in xrange(inputpdf.numPages):
print(i)
if i % 10 == 0:
j += 1
if i > 0:
with open(str(uuid.uuid4()) + ".pdf", "wb") as outputStream:
output.write(outputStream)
output = PdfFileWriter()
output.addPage(inputpdf.getPage(i))
j += 1
with open(str(uuid.uuid4()) + ".pdf", "wb") as outputStream:
output.write(outputStream)
qq += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment