A fast, local-first Streamlit app for PDF tasks — convert, compress, and generate PDFs. No cloud, no uploads, no hassle.
| Tool | Description |
|---|---|
| Image to PDF | Upload multiple images and combine them into a single PDF document with customizable margins and page ordering |
| Word to PDF | Convert Word documents (.docx) to PDF format |
| PDF to Word | Convert PDF documents to editable Word files (.docx) |
| PDF Compress | Reduce PDF file size by re-encoding images at lower quality and resolution |
- Python 3.11+
- Streamlit — Web UI framework
- Pillow — Image processing
- ReportLab — PDF generation (Image to PDF)
- docx2pdf — Word to PDF conversion
- pdf2docx — PDF to Word conversion
- pikepdf — PDF compression (image re-encoding)
pdfkit/
├── app.py # Streamlit entry point (tabbed UI)
├── requirements.txt # Python dependencies
├── src/
│ ├── __init__.py
│ ├── pdf_generator.py # Image → PDF
│ ├── word_to_pdf.py # Word → PDF
│ ├── pdf_to_word.py # PDF → Word
│ └── pdf_compress.py # PDF compression
├── .streamlit/
│ └── config.toml # Streamlit configuration
├── tests/
├── assets/
└── output/ # Generated files (not tracked)
- Python 3.11 or higher
- pip package manager
-
Clone the repository:
git clone https://github.com/yourusername/pdfkit.git cd pdfkit -
Create a virtual environment:
python -m venv venv # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
Note: Word to PDF conversion requires Microsoft Word installed on your system (Windows/macOS).
Run the Streamlit application:
streamlit run app.pyThe application will open in your browser at http://localhost:8501.
- Upload one or more images (PNG, JPG, JPEG, BMP, TIFF, WebP)
- Optionally set a PDF title and page margins in the sidebar
- Reorder images using comma-separated indices if needed
- Click Generate PDF and download the result
- Upload a .docx file
- Click Convert to PDF
- Download the generated PDF
- Upload a PDF file
- Click Convert to Word
- Download the generated .docx file
- Upload a PDF file
- Set a target file size (KB)
- Click Compress PDF
- Download the compressed file
- All file processing happens locally — no data is sent to external servers
- No API keys, tokens, or credentials are required
- Generated files are stored temporarily in the
output/directory and are not tracked
python -m pytest tests/- Create a new module in
src/with the core logic - Add a new tab in
app.py - Import and wire up the module in the new tab
- Keep UI and logic separate
This project is open source and available under the MIT License.