Skip to content

Pdf Reader .py file #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions PdfReader/doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import minecart
import os
import PyPDF2



# making new directory if it doesn't exist
new_dir_name = 'output'
filename = './sample.pdf'

if not os.path.exists(new_dir_name):
os.makedirs(new_dir_name + '/images')
os.makedirs(new_dir_name + '/text')



def searchKeyword(eText,keyWord):
pass

def searchImages(filename):
pass






extractedText = ''

# open the target file
pdf_file = open(filename, 'rb')
pdfReader = PyPDF2.PdfFileReader(pdf_file)


# printing number of pages in pdf file
pageCount = pdfReader.numPages

for i in range(pageCount):

pageObj = pdfReader.getPage(i)
extractedText += pageObj.extractText()
extractedText+=' '


print(extractedText)



# closing the pdf file object
pdf_file.close()
47 changes: 47 additions & 0 deletions SMTP Email Sender/email_send.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
import speechtotext
import time

# smtp gmail

def email_main():
to = "[email protected]"
user = "[email protected]"
password = "I can't tell you !!"


smtpserver = smtplib.SMTP('smtp.gmail.com', 587, timeout=30)
print("Here")
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo()
smtpserver.login ( user, password)

print("Here")

msg = MIMEMultipart()

msg['To']=to
msg['From']=user
print("say subject")
text=speechtotext.stot()
print(text)
msg['Subject']=text

msg.attach(MIMEText("Hello"))


#mail
fp=open('dog.png','rb')
msg.attach(MIMEImage(fp.read()))

smtpserver.sendmail ( user, to , msg.as_string())

#smtpserver.close()

print("mailed !!")