mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-12-18 00:00:14 +00:00
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)
|