This is a simple GUI application designed to convert PDF documents into various image formats, such as "png", "jpeg", "tiff", "pdf", "ps", "eps", "SVG", using pdftocairo
. It provides options to customize the conversion settings such as resolution, scaling, and cropping.
Before running this application, ensure that pdftocairo
is installed on your system. This tool is part of the Poppler utilities package, which can be installed as follows:
sudo apt-get install -y poppler-utils
brew install poppler
- Download and install Poppler for Windows from here.
- Add the path to
pdftocairo.exe
to your system's PATH environment variable OR put the script in the folder withpdftocairo.exe
, e.g.,poppler-24.07.0\Library\bin\
.
We also provide a precompiled EXE file for Windows users:
- Run directly by downloading the zip file here or QT version here
- Run with self-installed pdftocairo by downloading the EXE file here or QT version here
If you have Python installed, the application requires the following packages:
tkinter
(part of the standard library)Pillow
(Python Imaging Library)
If you need to install Pillow
, you can do so with pip:
pip install Pillow
After installing the required dependencies, run the Python script:
python pdf2img.py
- We also provide a QT version named
pdf2img_qt.py
based on PyQt5 with better interface. Install its dependency bypip install pyqt5
.
- Select PDF: Choose the PDF file you wish to convert.
- Output Format: Select the desired output format (PNG, JPEG, TIFF, etc.).
- Output Prefix: Provide a prefix for the output file name.
- Resolution (DPI): Set the resolution for the output image.
- Scale To (pixels): Scale the output to a specific pixel size.
- Crop (X Y W H): Define the area of the PDF page to be cropped.
- -singlefile: Check this option to output only the first page.
- -nocenter: Disable automatic centering of the output.
- Convert: Start the conversion process.
- Preview: View a preview of the first page of the PDF.
- Select the PDF file you want to convert using the Browse button.
- Choose the output format from the dropdown menu.
- Provide a prefix for the output file(s) in the Output Prefix field.
- Set optional parameters like resolution, scale, or cropping.
- Click the Convert button to start the conversion process.
- The status message will indicate whether the conversion was successful.
For more detailed instructions, click the Help button within the application.
If you encounter any issues or have suggestions for improvement, please submit them through the project's issue tracker.