Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c4e0720

Browse files
Merge pull request avinashkranjan#736 from Amit366/Amit
Pdf2Text
2 parents f7bacf6 + 6ebc12f commit c4e0720

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

‎PDF2Text/Readme.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
## DEMO
32+
33+
1) Select the PDF File
34+
35+
![Screenshot (127)](https://user-images.githubusercontent.com/60662775/112711916-ff837580-8ef1-11eb-998b-1c96fec1de2f.png)
36+
37+
2) Place the PDF File in the script folder
38+
39+
![Screenshot (128)](https://user-images.githubusercontent.com/60662775/112711924-12964580-8ef2-11eb-8aec-ef33fb3d19e1.png)
40+
41+
3) Now open cmd
42+
43+
![Screenshot (129)](https://user-images.githubusercontent.com/60662775/112711947-41142080-8ef2-11eb-80bb-71539b301b4e.png)
44+
45+
4) Enter the input like the PDF File path and number of pages
46+
47+
![Screenshot (131)](https://user-images.githubusercontent.com/60662775/112711986-846e8f00-8ef2-11eb-9cbd-cc6dc204b6b3.png)
48+
49+
5) The PDF File will be converted to text file (OUTPUT)
50+
51+
![Screenshot (132)](https://user-images.githubusercontent.com/60662775/112712000-92bcab00-8ef2-11eb-9191-252d6e6c526d.png)
52+
53+
54+
## Author
55+
56+
Amit Kumar Mishra
57+

‎PDF2Text/script.py

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /