Questions tagged [pdf2image]

A wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list.

pdf2image is a Python package that wraps pdftoppm and pdftocairo to convert PDF to a PIL Image object.

Resources

71 questions
0
votes
0 answers

Trying to ready the images using easyocr , but i see its taking more time or sometimes the kernel is getting dead and the output is empty

I have converted a pdf into a image and converting into arrays. However its taking too much time or almost kernel dead during this process and at the end getting empty o/p. How to handle this issue. kindly suggest. Code: images =…
Trend
  • 1
  • 1
  • 4
0
votes
1 answer

How to read PDF from file storage object in pdf2image?

I am working with flask, where I am uploading a pdf file to convert it to an image and perform OCR using pytesseract. However, pdf2image is not able to read the uploaded image. I tried searching on the internet but I could not find anything. I tried…
abhi
  • 337
  • 1
  • 3
  • 12
0
votes
0 answers

How to solve "Unable to get page count. Is poppler installed and in PATH?" when using pdf2image?

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…
林源煜
  • 26
  • 4
0
votes
0 answers

How to specify dpi of output jpg with pdf2image?

I have a simple code to convert pdf to jpg. I need the jpg output to be 1200 by 1500 pixels and 4 by 5 inches. I need 300 dpi. When I run the code it produces a jpeg with 96 dpi (1200 by >1500 - but I wanted to keep the ratio). I checked the docs…
CJD
  • 171
  • 1
  • 1
  • 13
0
votes
1 answer

Why does pdf2image increase the size of the image after converting it from a pdf?

I'm using pdf2image to convert a pdf to image(.png). However, the size of the image increases after the conversion. Here's the code I am using: path = "2x.pdf" pages = pdf2image.convert_from_path( path, dpi=300, …
Vikas Kumar
  • 85
  • 1
  • 11
0
votes
0 answers

How to convert pdf files into JPEG files and save them in ImageField of Django

I want to convert pdf files into jpeg files and save them as ImageField in Django. In my case, I already have pdf files in MyModel and some of them will be converted into jpeg files and saved as jpeg files as ImageField in AnotherModel. pdf_path =…
Kairi
  • 25
  • 1
  • 5
0
votes
1 answer

Python module not found - subdirectory

My main script reads another script that lies in a sub-folder "models". Codes had been working perfectly until recent tech refresh/whole machine updates. Error reads: Module not found. Error also happens when I try to import a library which ran…
soulynn
  • 89
  • 1
  • 3
  • 13
0
votes
1 answer

Module Not Found Error for 'pdf2image' in Python Script

I am working on a project to extract text from a bunch of scanned PDF's. I am following this tutorial. One of the first steps involves importing modules. I'm having some trouble importing 'pdf2image'. For context, I'm using a Conda environment…
Hiebs915
  • 666
  • 1
  • 7
  • 22
0
votes
0 answers

Copying a section from PDF with filled fields in Python

I will try to describe the process. Fill in the fields "Textové pole60" with value "123456789"in the interactive PDF using the following code and save it: from PyPDF4 import PdfFileWriter, PdfFileReader from PyPDF4.generic import BooleanObject,…
exik
  • 3
  • 3
-1
votes
1 answer

Multiple errors occurring when I try to convert pdf in jpeg

I need to convert .pdf file to .jpeg file to do OCR of the text. I found this code: from pdf2image import convert_from_path pages = convert_from_path('img732.pdf', 500) for page in pages: page.save('out.jpg', 'JPEG') And I got this…
daav_v
  • 25
  • 6
-2
votes
1 answer

Trying to loop through multiple PDF files and save the individual pages of those PDF as images

I am working on a python project which requires me to loop through the multiple pdfs one by one stored in a folder called sample/ of my current directory and save the individual pages of those pdfs as images in another directory called…
1 2 3 4
5