79150676

Date: 2024-11-02 12:40:36
Score: 2.5
Natty:
Report link

How to specify dpi of output jpg with pdf2image?

You can specify the dpi of output jpg convert_from_path method by passing a second argument of DPI like this

from pdf2image import convert_from_path

pages = convert_from_path('sample.pdf', 400) #400 is the Image quality in DPI (default 200)

pages[0].save("sample.png")

Source: stackoverflow: converting pdf to image but after zooming in

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How to
  • Low reputation (1):
Posted by: Anurag Verma