Converting Pdf Into Word

Ditutup Dipasang 3 tahun yang lalu Dibayar saat pengiriman
Ditutup Dibayar saat pengiriman

As we see, the pages of the PDF were converted to images. Then the images were read, and the content was written into a text file.

Advantages of this method include:

Avoiding text-based conversion because of encoding scheme resulting in loss of data.

Even handwritten content in PDF can be recognized due to the usage of OCR.

Recognizing only particular pages of the PDF is also possible.

Getting the text as a variable so that any amount of required pre-processing can be done.

Disadvantages of this method include:

Disk storage is used to store the images in the local system. Although these images are tiny in size.

Using OCR cannot guarantee 100% accuracy. Given a computer typed PDF document results in very high accuracy.

Handwritten PDFs are still recognized, but the accuracy depends on various factors like handwriting, page color, etc.

Part #1 deals with converting the PDF into image files. Each page of the PDF is stored as an image file. The names of the images stored are:

PDF page 1 -> [login to view URL]

PDF page 2 -> [login to view URL]

PDF page 3 -> [login to view URL]

….

PDF page n -> [login to view URL]

Part #2 deals with recognizing text from the image files and storing it into a text file. Here, we process the images and convert it into text. Once we have the text as a string variable, we can do any processing on the text. For example, in many PDFs, when a line is completed, but a particular word cannot be written entirely in the same line, a hyphen (‘-‘) is added, and the word is continued on the next line. For example –

This is some sample text but this parti-

cular word could not be written in the same line.

Now for such words, a fundamental pre-processing is done to convert the hyphen and the new line into a full word. After all the pre-processing is done, this text is stored in a separate text file.

To get the input PDF files used in the code, click [login to view URL]

Below is the implementation:

filter_none

brightness_4

# Import libraries

from PIL import Image

import pytesseract

import sys

from pdf2image import convert_from_path

import os

# Path of the pdf

PDF_file = "[login to view URL]"

'''

Part #1 : Converting PDF to images

'''

# Store all the pages of the PDF in a variable

pages = convert_from_path(PDF_file, 500)

# Counter to store images of each page of PDF to image

image_counter = 1

# Iterate through all the pages stored above

for page in pages:

# Declaring filename for each page of PDF as JPG

# For each page, filename will be:

# PDF page 1 -> [login to view URL]

# PDF page 2 -> [login to view URL]

# PDF page 3 -> [login to view URL]

# ....

# PDF page n -> [login to view URL]

filename = "page_"+str(image_counter)+".jpg"

# Save the image of the page in system

[login to view URL](filename, 'JPEG')

# Increment the counter to update filename

image_counter = image_counter + 1

'''

Part #2 - Recognizing text from the images using OCR

'''

3

# Variable to get count of total number of pages

filelimit = image_counter-1

# Creating a text file to write the output

outfile = "[login to view URL]"

# Open the file in append mode so that

# All contents of all images are added to the same file

f = open(outfile, "a")

# Iterate from 1 to total number of pages

for i in range(1, filelimit + 1):

# Set filename to recognize text from

# Again, these files will be:

# [login to view URL]

# [login to view URL]

# ....

# [login to view URL]

filename = "page_"+str(i)+".jpg"

# Recognize the text as string in image using pytesserct

text = str(((pytesseract.image_to_string([login to view URL](filename)))))

# The recognized text is stored in variable text

# Any string processing may be applied on text

# Here, basic formatting has been done:

# In many PDFs, at line ending, if a word can't

# be written fully, a 'hyphen' is added.

# The rest of the word is written in the next line

# Eg: This is a sample text this word here GeeksF-

# orGeeks is half on .

OCR PDF Entri Data Word Pengetikan Salinan

ID Proyek: #29343282

Tentang proyek

33 proposal Proyek online Aktif 2 tahun yang lalu

33 freelancer rata-rata menawar ₹19330 untuk pekerjaan ini

AnowarRatul

PDF--WORD EXPERT -------I AM AVAILABLE RIGHT NOW-----100% ACCURACY I can do this work checked your whole description and attachments . Please knock me then I can do this Thanks

₹29000 INR dalam 20 hari
(192 Ulasan)
6.0
IYakubovsky

Good Day! I am Ilxam and I have read your requirements and already ready to start working. Just contact me and I will finish your project in a short time for cheap price

₹12500 INR dalam 1 hari
(1 Ulasan)
0.0
bilalqasim000

Dear sir , I've just gone through your project, so I have expertise in such assignment as having a great experience for working on well reputed organization on corporate level. Highly goal given professional with s Lebih banyak

₹22222 INR dalam 4 hari
(0 Ulasan)
0.0
Wrekonharbour

You will get the results as you want in just a couple of days!!! I'm a student of graduation so I have enough knowledge that I can do this work efficiently... this is just what I want to say

₹12778 INR dalam 2 hari
(0 Ulasan)
0.0
john007christoph

I am the best candidate. If you want I will complete before the deadline. Suggest me if you want any changes.

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
DMJFree

I have very good experience in windows office, all kind of file conversion (Pdf to MS word, excel, PowerPoint, images etc.),cad and 3D modeling and i am having more than 18 experiences in this field, and i have all lic Lebih banyak

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
Halkeshkushwah76

Hello Dear I have read your project and I have understood your project. I have the experience to do this type of project earlier. I have worked many platforms before. So, I have the confidence to do this. If you want w Lebih banyak

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
cpreetha0912

Hi, I will summarize all the pdfs and provide you with clear, concise notes. I have worked on similar projects compiling presentation slides and lecture notes into a single set of notes, and can deliver quality notes t Lebih banyak

₹13000 INR dalam 3 hari
(0 Ulasan)
0.0
imtiyazalam3658

I convert pdf to word in a professional way I am very advanced in this work, so please hire me for this

₹12778 INR dalam 1 hari
(0 Ulasan)
0.0
okellitto

delivery date might be sooner..loyal hardworking and a man looking to sustain himself i can do the job perfectly

₹12500 INR dalam 3 hari
(0 Ulasan)
0.0
Subashraghu

I Subash, In freelancer. I have 5 years experience in this field. Services include PDF Conversion, Typesetting and Cover design.

₹16667 INR dalam 2 hari
(0 Ulasan)
0.0
hrithikraj00000

I am certified Data Entry Worker. I have published two books. I can't make any mistakes. I have done many jobs... I have two year experience in it.

₹15000 INR dalam 7 hari
(0 Ulasan)
0.0
renzdemaala12

Hi, I'm interested in you job ad and would like to work in gathering data and data entry. Short introduction about myself: my name is Celso Renz Dema-ala. a 26 year old Architect from the Philippines. I had around 1 ye Lebih banyak

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
dahanesanket25

Hi, I have read your requirements and I am very interested in this project. I have required skills and experience to do this for you at reasonable price. Please feel free to contact me. Regards, Sanket Dahane

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
owais6387

hello, my name is Awais khan I am a dedicated and hard working person who believes in honesty and good working relation. though i am new it this sector of job but i have certain qualities which makes me good at this.

₹12500 INR dalam 2 hari
(0 Ulasan)
0.0
harshiiid09

As this pandemic brings us to home so I have learnt to manage all things online which also include PDF and word file conversions so I feel am good at this . I will do the quality job and will complete the task on time.

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
ujjwalkumarcse13

I have scanned many books and converted them to pdfs and separated them in chapters. If you want the perfect completion of the project. Contact me.

₹13000 INR dalam 7 hari
(0 Ulasan)
0.0
pvpriyankaverma6

Will ensure good quality work and that too within the mentioned timeline. I am sure you will be happy to work with me.

₹25000 INR dalam 7 hari
(0 Ulasan)
0.0
phadte77

I'm here to help you. I am well versed with the conversion content in pdf to text format in word. doing this conversion for past 2 to 3 years. I will provide you the desired results. awaiting for your positive response Lebih banyak

₹13889 INR dalam 4 hari
(0 Ulasan)
0.0
anipkharel191

Hey, I am Student of Computer Engineering. I want this project cause I am good at typing and can complete the task within the given Deadline.

₹13611 INR dalam 7 hari
(0 Ulasan)
0.0