How to install Poppler on Windows?

后端 未结 13 2315
长发绾君心
长发绾君心 2020-11-29 02:08

The most recent version of ScraperWiki depends on Poppler (or so the GitHub says). Unfortunately, it only specifies how to get it on macOS and Linux, not Windows.

A

13条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 02:24

    To Simply install Poppler on Windows run through the below mentioned steps without touching the environmental varible.

    1. Download the Latest Poppler Binary from the URL: http://blog.alivate.com.au/poppler-windows/index.html
    2. Unzip it and copy the poppler-0.68.0_x86 folder in some path for ex, C:/User/Poppler/poppler-0.68.0_x86/poppler-0.68.0/bin

    Now go to your Python code where you want to call Poppler for image conversion and use the below mentioned code snippet:

    from pdf2image import convert_from_path
    pages = convert_from_path('MyPdf.pdf', 500, poppler_path = r'C:\User\Poppler\poppler-0.68.0_x86\poppler-0.68.0\bin')
    for page in pages:
        page.save('out.jpg', 'JPEG')
    

提交回复
热议问题