PDFConverter converts images and office documents to PDF. A Tkinter file picker guides you through three steps:
- Select one or more files.
- Enter an output name.
- The resulting PDF is saved to your desktop.
- Convert PNG, JPG, JPEG, BMP, and GIF images directly with Pillow.
- Convert office and document formats through LibreOffice.
- Merge multiple converted documents into one PDF.
- Preserve the order in which files were selected.
- Run on Windows, macOS, and Linux.
- Use a native file picker instead of requiring command-line arguments.
- Keep temporary LibreOffice output isolated from your source files.
- Python 3.7+
- Tkinter
- Pillow
- PyPDF2
- LibreOffice for non-image conversion
Tkinter is bundled with many Python distributions. On Linux, it may need to be installed separately through your distribution's package manager.
Clone the repository:
git clone https://github.com/emillvl/pdfconverter.git
cd pdfconverterInstall the Python dependencies:
python -m pip install -r requirements.txtFor document conversion, install LibreOffice as well.
Install LibreOffice from its official installer. PDFConverter checks common LibreOffice installation locations and also accepts soffice or libreoffice when available on PATH.
A common installation method is:
brew install --cask libreofficeThe application also checks the standard LibreOffice application path under /Applications.
sudo apt update
sudo apt install libreoffice python3-tkOther Linux distributions can install the equivalent LibreOffice and Tk packages through their package manager.
Run:
python PDFConverter/converter.pyThe application will:
- Open a file-selection dialog.
- Ask for the output PDF name.
- Save the result to the detected desktop directory.
If no desktop directory can be detected, PDFConverter falls back to the user's home directory.
If every selected input is one of the supported image formats, PDFConverter uses Pillow directly and does not require LibreOffice.
Supported image extensions:
.png.jpg.jpeg.bmp.gif
Images are converted to RGB and written to a single PDF in selection order.
If any selected file is not one of the supported image extensions, PDFConverter uses LibreOffice for the conversion flow.
LibreOffice determines which document formats are actually convertible. Typical examples include:
- DOC / DOCX
- XLS / XLSX
- PPT / PPTX
- ODT / ODS / ODP
- RTF
Each source file is converted inside its own temporary directory. This prevents same-named input files from overwriting one another and avoids modifying or deleting PDFs beside the original source files.
When multiple converted PDFs are produced, PyPDF2 merges them in the original selection order.
-
The output filename is used without an overwrite confirmation. Choose a new name if a PDF with that name already exists in the destination folder.
-
A mixed selection of images and documents is handled through LibreOffice rather than the direct Pillow image path.
-
Conversion fidelity for office documents depends on LibreOffice and the fonts available on the machine.
-
Password-protected, corrupted, unsupported, or unusually structured files may fail to convert.
-
The current GUI is Turkish-language.
-
The application does not recursively convert folders.
Confirm that LibreOffice is installed and can be launched normally.
You can also check whether its command is available:
soffice --versionor:
libreoffice --versionOn Windows, the executable is commonly located under:
C:\Program Files\LibreOffice\program\soffice.exe
On Ubuntu or Debian:
sudo apt install python3-tkFor other platforms, use the Tk package appropriate for your Python installation.
Reinstall the Python dependencies:
python -m pip install -r requirements.txtPyPDF2 is required when multiple LibreOffice-generated PDFs need to be merged.
PDFConverter uses the configured desktop location when it can detect one. If no valid desktop directory is available, it saves to the user's home directory instead.
pdfconverter/
├── PDFConverter/
│ └── converter.py
├── LICENSE
├── README.md
└── requirements.txt
The conversion logic lives in PDFConverter/converter.py. LibreOffice renders office documents.
When changing conversion behavior, useful regression cases include:
- one image
- multiple images
- one office document
- multiple office documents
- two files with the same basename from different directories
- a source directory that already contains a PDF with the same basename
- LibreOffice missing
- PyPDF2 missing during a multi-document merge
PDFConverter is licensed under the MIT License. See LICENSE.
Emil Veliyev · @emillvl