Created
March 3, 2018 06:36
-
-
Save SauloSilva/97f7fa0a83acc368f04a0bbfbed5c931 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pdftotext | |
# Load your PDF | |
with open("teste.pdf", "rb") as f: | |
pdf = pdftotext.PDF(f) | |
# How many pages? | |
print(len(pdf)) | |
# Iterate over all the pages | |
for page in pdf: | |
print(page) | |
# Read all the text into one string | |
text = "\n\n".join(pdf) | |
print(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment