GithubHelp home page GithubHelp logo

evelynl09 / pdftojpg Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.95 MB

A Python script to convert PDFs to JPG images using pdf2image library.

License: MIT License

Python 100.00%
converter image pdf pdf2image python utility windows jpeg jpg

pdftojpg's Introduction

PDFToJPG

A Python script to convert PDFs to JPG images using pdf2image library.

Configuring the Environment on Windows

To run the script on Windows, you'll need to install the necessary Python packages and the Poppler utility. Follow these steps to configure your environment:

  1. Install the required Python packages by running pip install -r requirements.txt in a command prompt or terminal window.

  2. Install Poppler:

    • Download the latest version of Poppler for Windows from Poppler Windows Releases.
    • Extract the contents of the downloaded .zip archive to a directory on your computer, such as C:\Software\poppler.
    • Add the path to the Library\bin directory within the extracted Poppler directory (e.g., C:\Software\poppler\Library\bin) to your system's PATH environment variable.
    • Open a new command prompt window and run pdftoppm -v to verify that Poppler has been installed correctly and is available in your PATH.

After completing these steps, you should be able to run the script on your Windows computer.

Running the Script

After completing the steps above to configure your environment, you can run the script by opening a command prompt or terminal window, navigating to the directory containing the script, and running the following command:

python3 converter.py

This will execute the script using Python 3 and convert all the PDF files in the input directory to JPG images in the output directory.

配置使用环境 - 以Windows为例

  1. 安装需要的python包pip install -r requirements.txt
  2. 安装poppler
    • Poppler Windows Releases下载安装包,解压到指定文件夹
    • 配置系统环境变量,将解压后的Libary/bin所在路径加入PATH变量,e.g. C:\Software\poppler\Library\bin
    • 新打开一个命令行窗口,执行pdftoppm -v确认配置成功

执行脚本

python3 converter.py

这个脚本将会把所有input路径下的PDF转为JPG图片到output路径下

pdftojpg's People

Contributors

evelynl09 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.