Skip to content

Commit 89b45e2

Browse files
committed
PDF2Text
1 parent ed100fa commit 89b45e2

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

PDF2Text/Readme.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# <b>PDF2Text</b>
2+
3+
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
4+
5+
## PDF2Text Functionalities : 🚀
6+
7+
- Converts PDF file to a text file
8+
9+
## PDF2Text Instructions: 👨🏻‍💻
10+
11+
### Step 1:
12+
13+
Open Termnial 💻
14+
15+
### Step 2:
16+
17+
Locate to the directory where python file is located 📂
18+
19+
### Step 3:
20+
21+
Run the command: python script.py/python3 script.py 🧐
22+
23+
### Step 4:
24+
25+
Sit back and Relax. Let the Script do the Job. ☕
26+
27+
### Requirements
28+
29+
- PyPDF2
30+
31+
## Author
32+
33+
Amit Kumar Mishra
34+

PDF2Text/script.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import PyPDF2
2+
3+
pdf = input("Enter the path of PDF file")
4+
n = int(input("Enter number of pages"))
5+
st=""
6+
page = PyPDF2.PdfFileReader(pdf)
7+
for i in range(1,n+1):
8+
9+
st += page.getPage(i).extractText()
10+
11+
with open('./PDF2Text/pages/text.txt','w') as f:
12+
f.write(st)
13+
14+

0 commit comments

Comments
 (0)