mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-24 04:21:12 +00:00
10 lines
264 B
Python
10 lines
264 B
Python
import PyPDF2
|
|
import pyttsx3
|
|
path = open('daily-python-scripts\scripts\PDF to Voice\sample.pdf', 'rb')
|
|
pdfReader = PyPDF2.PdfFileReader(path)
|
|
from_page = pdfReader.getPage(0)
|
|
text = from_page.extractText()
|
|
speak = pyttsx3.init()
|
|
speak.say(text)
|
|
speak.runAndWait()
|