Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions PDF2Text/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# <b>PDF2Text</b>

[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)

## PDF2Text Functionalities : 🚀

- Converts PDF file to a text file

## PDF2Text Instructions: 👨🏻‍💻

### Step 1:

Open Termnial 💻

### Step 2:

Locate to the directory where python file is located 📂

### Step 3:

Run the command: python script.py/python3 script.py 🧐

### Step 4:

Sit back and Relax. Let the Script do the Job. ☕

## Requirements

- PyPDF2

## DEMO

1) Select the PDF File

![Screenshot (127)](https://user-images.githubusercontent.com/60662775/112711916-ff837580-8ef1-11eb-998b-1c96fec1de2f.png)

2) Place the PDF File in the script folder

![Screenshot (128)](https://user-images.githubusercontent.com/60662775/112711924-12964580-8ef2-11eb-8aec-ef33fb3d19e1.png)

3) Now open cmd

![Screenshot (129)](https://user-images.githubusercontent.com/60662775/112711947-41142080-8ef2-11eb-80bb-71539b301b4e.png)

4) Enter the input like the PDF File path and number of pages

![Screenshot (131)](https://user-images.githubusercontent.com/60662775/112711986-846e8f00-8ef2-11eb-9cbd-cc6dc204b6b3.png)

5) The PDF File will be converted to text file (OUTPUT)

![Screenshot (132)](https://user-images.githubusercontent.com/60662775/112712000-92bcab00-8ef2-11eb-9191-252d6e6c526d.png)


## Author

Amit Kumar Mishra

13 changes: 13 additions & 0 deletions PDF2Text/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import PyPDF2

pdf = input(r"Enter the path of PDF file: ")
n = int(input("Enter number of pages: "))

page = PyPDF2.PdfFileReader(pdf)
for i in range(n):
st=""
st += page.getPage(i).extractText()

with open(f'./PDF2Text/text{i}.txt','w') as f:
f.write(st)