Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

read text from a pdffile python

# importing required modules 
import PyPDF2 
    
# creating a pdf file object 
pdfFileObj = open('example.pdf', 'rb') 
    
# creating a pdf reader object 
pdfReader = PyPDF2.PdfFileReader(pdfFileObj) 
    
# printing number of pages in pdf file 
print(pdfReader.numPages) 
    
# creating a page object 
pageObj = pdfReader.getPage(0) 
    
# extracting text from page 
print(pageObj.extractText()) 
    
# closing the pdf file object 
pdfFileObj.close()
Comment

PREVIOUS NEXT
Code Example
Python :: load static files in django 
Python :: django setup allowed hosts 
Python :: capitalize first letter in python 
Python :: import counter python 
Python :: feet to meter python 
Python :: create a vector of zeros in r 
Python :: how to change the title of a tkinter widnow 
Python :: pyhton turtle delete 
Python :: coco.py 
Python :: How to Copy a File in Python? 
Python :: python copy all files in a folder to nother folder 
Python :: python temporaty files 
Python :: how to use enumerate instead of range and len 
Python :: python get min max value from a dictionary 
Python :: get gpu name tensorflow and pytorch 
Python :: make a specific column a df index 
Python :: change the color of the button on hovering tkinter 
Python :: how to create your own programming language in python 
Python :: find null value for a particular column in dataframe 
Python :: index of sorted list python 
Python :: how to find python version 
Python :: recursive python program to print numbers from n to 1 
Python :: CUDA error: device-side assert triggered 
Python :: find duplicate in dataset python 
Python :: force utf-8 encoding python 
Python :: how to show webcam in opencv 
Python :: Violin Plots in Seaborn 
Python :: createview 
Python :: python des 
Python :: how to draw a bar graph in python 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =