Skip to content

Instantly share code, notes, and snippets.

@ephes
Created March 11, 2019 19:01
Show Gist options
  • Save ephes/4ce04e3b1b1f3b0242659313a8c705ff to your computer and use it in GitHub Desktop.
Save ephes/4ce04e3b1b1f3b0242659313a8c705ff to your computer and use it in GitHub Desktop.
import sys
from PyPDF2 import PdfFileReader
pages = []
doc = PdfFileReader(sys.argv[1])
for num in range(doc.numPages):
page = doc.getPage(num)
pages.append(page.extractText())
print("\n".join(pages))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment