I am using module pdf2drive to convert my pdf file to image. But when I run, an error message poped up: "Unable to get page count. Is poppler installed and in PATH?"
I installed the poppler and I've added the path to Environment variables. In command prompt, it can run normally. message in command prompt
But afterwards, the same error message reported in IDE. error message in IDE
What should I do to solve this problem? Thanks!
This is my code:
import cv2
import pytesseract
from PIL import Image
import sys
from pdf2image import convert_from_path
import os
pdf_file = 'historical_data.pdf'
pages = convert_from_path(pdf_file,600)
image_path = 'pdf_image/'
image_counter = 1
for page in pages:
filename = "page_"+str(image_counter)+".png"
page.save(image_path+filename,600)
image_counter +=1