mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 22:11:07 +00:00
d7b46ecaac
Co-authored-by: pham.huu.quang <SUN-ASTERISK\pham.huu.quang@b121686-lt.sun-asterisk.com>
16 lines
321 B
Python
16 lines
321 B
Python
import os
|
|
import pdftotext
|
|
|
|
|
|
pdf_path = input("Enter the path of the pdf file : ")
|
|
|
|
assert os.path.exists(pdf_path), "this pdf file doesn't exist"
|
|
|
|
with open(pdf_path, 'rb') as f_r:
|
|
pdf_pages = pdftotext.PDF(f_r)
|
|
|
|
for i, page in enumerate(pdf_pages):
|
|
print('Page {}'.format(i))
|
|
print(page)
|
|
print('*'*100)
|