Python: PDF

From OnnoWiki
Revision as of 05:24, 25 October 2018 by Onnowpurbo (talk | contribs) (Created page with "==pyPDF2== #install pyPDF2 pip install PyPDF2 # importing all the required modules import PyPDF2 # creating an object file = open('example.pdf', 'rb') # creating a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

pyPDF2

#install pyPDF2
pip install PyPDF2
# importing all the required modules
import PyPDF2
# creating an object 
file = open('example.pdf', 'rb')
# creating a pdf reader object
fileReader = PyPDF2.PdfFileReader(file)
# print the number of pages in pdf file
print(fileReader.numPages)

Referensi