mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
add script for convert pdf to text (#183)
Co-authored-by: pham.huu.quang <SUN-ASTERISK\pham.huu.quang@b121686-lt.sun-asterisk.com>
This commit is contained in:
parent
80bfc6c98d
commit
d7b46ecaac
11
PDF2text/README.md
Normal file
11
PDF2text/README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Description: PDF2text
|
||||
this is a small script to make a extract text from pdf file.
|
||||
|
||||
### Dependencies:
|
||||
1- [pdftotext](https://pypi.org/project/pdftotext/)
|
||||
|
||||
## Usage
|
||||
Run ```python script.py``` then enter path of pdf file.
|
||||
|
||||
|
||||
|
1
PDF2text/requirements.txt
Normal file
1
PDF2text/requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
pdftotext
|
15
PDF2text/script.py
Normal file
15
PDF2text/script.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
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)
|
|
@ -156,10 +156,10 @@ So far, the following projects have been integrated to this repo:
|
|||
|[Codeforces Checker](codeforcesChecker)|[Jinesh Parakh](https://github.com/jineshparakh)|
|
||||
|[Github repo creator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Git_repo_creator)|[Harish Tiwari ](https://github.com/optimist2309)
|
||||
|[Remove-Duplicate-Files](Remove-Duplicate-Files)|[Aayushi Varma](https://github.com/aayuv17)
|
||||
|[PDF2text](PDF2text)|[QuangPH](https://github.com/quangph-1686a)
|
||||
|[Image Watermarker (batch)](Image Watermarker (batch))|[Remco Halman](https://github.com/remcohalman)
|
||||
|
||||
|
||||
|
||||
## How to use :
|
||||
|
||||
- Clone/Download the directory and navigate to each folder. Or...
|
||||
|
|
Loading…
Reference in New Issue
Block a user