mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2025-02-06 16:40:54 +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)
|