
longcv
Posted at March 16, 2022, 5:10 p.m.
0
import packages
import PyPDF2 import re from PyPDF2 import PdfFileWriter import io from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import letter
Mở file pdf
object = PyPDF2.PdfFileReader("SKU.pdf")
Lấy số trang
NumPages = object.getNumPages()
Xác định từ khóa
Strings = " SiliconHandGloves | 1 |street"
Xuất văn bản và thực hiện tìm kiếm
for i in range(0, NumPages): PageObj = object.getPage(i) print("this is page " + str(i)) Text = PageObj.extractText() print(Text) ResSearch = re.search(Strings, Text) # print(ResSearch)
